Webhook Inspector

Inbound deliveries with payload and response. Signature status is its own field, never folded into the status code — a 200 with an invalid signature is a forged request your handler accepted.

src/components/ui/webhook-inspector.tsx

About

From the component's own source, where it was written.

Inbound webhook deliveries, with payload and response.

Both directions are kept: what arrived and what we answered. A webhook failure is nearly always a disagreement between the two, and a log that stores only the payload cannot tell you whether the sender was wrong or your handler was.

Signature verification status is its own field, separate from the response code. A delivery can return 200 and have failed verification — that is a forged request your handler accepted, and it must not be buried under a green status.

Retries are grouped under their original delivery rather than listed separately, so five rows of the same event read as one problem rather than five.

Install

npx astralyx-ui add webhook-inspector

Usage

import { WebhookInspector } from '@/components/ui/webhook-inspector'

<WebhookInspector deliveries={deliveries} onReplay={replay} />

Composer

Change the props and the source below follows.

Props
tsx
<WebhookInspector deliveries={deliveries} onReplay={replay} />

Examples

Deliveries, one of them failing

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

WebhookInspector

Extends Omit<ComponentProps<'div'>, 'children'>.

PropTypeDefaultDescription
deliveriesWebhookDelivery[]required{ id, event, at, status?, durationMs?, payload?, responseBody?, signature?, attempt? }.
onReplay(id: string) => void—Omit for a read-only log.
nowDate——
localestring'en-GB'—
emptyLabelReactNode'No deliveries yet'—
payloadLabelReactNode'Payload'—
responseLabelReactNode'Response'—
replayLabelReactNode'Replay'—
attemptLabel(attempt: number, max?: number) => ReactNodeDEFAULT_ATTEMPT_LABEL—
forgedNoteReactNode'This request was accepted with an invalid signature — it may not have come from the sender you expect.'Shown when a delivery succeeded despite a bad signature.

Types

WebhookDelivery

Inbound webhook deliveries, with payload and response.

FieldTypeDescription
idstring—
eventstring—
atDate—
status?number—
durationMs?number—
payload?Json—
responseBody?string—
signature?'valid' | 'invalid' | 'missing' | 'unchecked'Separate from the status. A delivery that returned 200 with an invalid signature is called out explicitly.
attempt?number—
maxAttempts?number—

Behaviour

TopicDetailDescription
both directionskeptWhat arrived and what you answered. A webhook failure is a disagreement between the two, and storing only the payload cannot say which side was wrong.