A comprehensive admin interface for monitoring webhook deliveries, debugging integration issues, and retrying failed events.
- Events Table: Displays timestamp, event type, status, HTTP status, payload preview, and retry count
- Status Filtering: Filter by success, failed, pending, or retrying status
- Event Type Filtering: Filter by specific webhook event types
- Retry Functionality: Retry failed webhooks with visual feedback
- JSON Viewer: Expandable modal with formatted JSON payload and response
- Real-time Updates: Optional live updates for webhook events
- Responsive Design: Mobile, tablet, and desktop support
- Accessibility: WCAG 2.1 AA compliant with proper ARIA labels and keyboard navigation
- TypeScript Strict: No
anytypes used throughout the implementation
app/
├── admin/
│ └── webhooks/
│ └── page.tsx # Main admin webhooks page
└── api/
└── webhooks/
├── events/
│ └── route.ts # GET endpoint for fetching events
└── retry/
└── route.ts # POST endpoint for retrying webhooks
components/
├── atoms/
│ └── WebhookStatusBadge.tsx # Status badge with icons
├── molecules/
│ ├── WebhookEventRow/
│ │ ├── WebhookEventRow.tsx # Table row component
│ │ └── index.ts
│ ├── WebhookDetailsModal/
│ │ ├── WebhookDetailsModal.tsx # Full event details modal
│ │ └── index.ts
│ └── WebhookFilterBar/
│ ├── WebhookFilterBar.tsx # Filter controls
│ └── index.ts
└── organisms/
└── WebhookEventLogsViewer/
├── WebhookEventLogsViewer.tsx # Main viewer component
└── index.ts
lib/
├── types/
│ └── webhook.ts # TypeScript type definitions
├── api/
│ └── mock/
│ └── webhookEvents.ts # Mock data (10 sample events)
└── webhook/
└── webhookFilters.ts # Filtering and sorting logic
interface WebhookEvent {
id: string;
timestamp: string;
eventType: WebhookEventType;
status: WebhookEventStatus;
endpoint: string;
httpStatus: number | null;
payload: WebhookEventPayload;
response: string | null;
errorMessage: string | null;
retryCount: number;
maxRetries: number;
nextRetryAt: string | null;
}credit.issuedcredit.retiredcredit.transferredproject.approvedproject.updatedtransaction.completedtransaction.failedwallet.createdpayment.receivedpayment.failed
success- Event delivered successfullyfailed- Event delivery failedpending- Event pending deliveryretrying- Event being retried
Main container component that orchestrates the entire webhook logs interface.
Props:
events: WebhookEvent[]- Array of webhook eventsonRetryEvent?: (eventId: string) => Promise<void>- Callback for retry actionenableRealtime?: boolean- Enable real-time updates
Features:
- State management for filters, selection, and modal
- Real-time event updates (simulated)
- Optimistic UI updates on retry
- Empty state handling
Individual table row displaying webhook event summary.
Props:
event: WebhookEvent- Event dataonRetry: (eventId: string) => void- Retry callbackonViewDetails: (event: WebhookEvent) => void- View details callbackisRetrying?: boolean- Loading state for retry button
Features:
- Payload preview (first 3 keys)
- Conditional retry button (only for failed events)
- Color-coded HTTP status
- Accessible table structure
Full-screen modal displaying complete event details.
Props:
isOpen: boolean- Modal visibilityevent: WebhookEvent | null- Event to displayonClose: () => void- Close callback
Features:
- Formatted JSON display with syntax highlighting
- Copy to clipboard functionality
- Metadata grid layout
- Error message highlighting
- Keyboard accessible (ESC to close)
Filter and search controls for the events table.
Props:
filters: WebhookFilterState- Current filter stateonFilterChange: (filters: Partial<WebhookFilterState>) => void- Filter change callbackeventTypes: WebhookEventType[]- Available event typesresultCount: number- Filtered results counttotalCount: number- Total events count
Features:
- Search by ID, event type, endpoint, or error
- Status dropdown filter
- Event type dropdown filter
- Sort by timestamp, event type, or status
- Sort order toggle (asc/desc)
- Results count display
Visual status indicator with icon and color coding.
Props:
status: WebhookEventStatus- Event statusclassName?: string- Additional CSS classessize?: 'sm' | 'md'- Badge size
Features:
- Status-specific icons (✓, ✕, ○, ↻)
- Color-coded variants
- Tooltip with description
Fetch webhook events with optional filtering.
Query Parameters:
status?: string- Filter by statuseventType?: string- Filter by event typelimit?: number- Limit results (default: 100)
Response:
{
"events": WebhookEvent[],
"total": number,
"timestamp": string
}Retry a failed webhook event.
Request Body:
{
"eventId": string
}Response:
{
"success": boolean,
"eventId": string,
"message": string,
"status": string
}- Semantic HTML: Proper table structure with
<thead>,<tbody>,<th>,<td> - ARIA Labels: All interactive elements have descriptive labels
- Keyboard Navigation: Full keyboard support for all actions
- Focus Management: Modal traps focus, returns focus on close
- Screen Reader Support: Status announcements and descriptions
- Color Contrast: WCAG AA compliant color combinations
- Responsive Tables: Horizontal scroll on mobile with sticky headers
- Stacked filter controls
- Horizontal scrolling table
- Full-width modal
- Touch-friendly button sizes
- 2-column filter grid
- Optimized table layout
- Adjusted modal width
- 4-column filter grid
- Full table visibility
- Large modal with side-by-side layout
When enableRealtime={true}:
- Polls for status changes every 5 seconds
- Updates retrying events to success/failed
- Visual "Live" indicator with pulsing dot
- Optimistic UI updates on user actions
10 sample webhook events covering all event types and statuses:
- 5 successful events
- 2 failed events
- 1 retrying event
- 1 pending event
- 1 event with no HTTP status
<Link href="/admin/webhooks">Webhook Logs</Link>// In app/admin/webhooks/page.tsx
const { data } = await fetch('/api/webhooks/events');
<WebhookEventLogsViewer
events={data.events}
onRetryEvent={async (eventId) => {
await fetch('/api/webhooks/retry', {
method: 'POST',
body: JSON.stringify({ eventId }),
});
}}
enableRealtime={true}
/>;- Connect to database for event storage
- Implement webhook delivery system
- Add retry queue with exponential backoff
- Set up real-time event streaming (WebSocket/SSE)
- Table loads with all columns
- Search filters events correctly
- Status filter works for all statuses
- Event type filter works for all types
- Sort by timestamp/event type/status works
- Sort order toggle works
- Retry button only shows for failed events
- Retry triggers API call and updates UI
- View button opens modal with full details
- Modal displays formatted JSON
- Copy to clipboard works
- Modal closes on ESC key
- Modal closes on backdrop click
- Empty state displays when no results
- Real-time updates work (if enabled)
- Responsive on mobile devices
- Keyboard navigation works
- Screen reader announces status changes
- Color contrast meets WCAG AA
- No TypeScript errors
- No console errors
- Pagination for large datasets
- Bulk retry for multiple failed events
- Export events to CSV/JSON
- Webhook endpoint management
- Event replay functionality
- Advanced filtering (date range, HTTP status)
- Webhook delivery analytics dashboard
- Custom retry strategies per event type
- Webhook signature verification logs
- Integration with monitoring tools (Sentry, DataDog)
- Virtual scrolling for large event lists
- Debounced search input
- Memoized filter functions
- Lazy loading of event details
- Optimistic UI updates
- Request caching with React Query
- Server-side pagination
- WebSocket for real-time updates (instead of polling)
- Admin-only access (add authentication middleware)
- Rate limiting on retry endpoint
- Payload sanitization in display
- CSRF protection on POST endpoints
- Audit logging for retry actions
- Sensitive data masking in payloads
- Role-based access control (RBAC)
Status: ✅ Implementation Complete Last Updated: February 24, 2026 Developer: Senior Developer Implementation