UI

Webhook tester

Developer webhook tester with endpoint validation, event type selector, masked signing secret, syntax-tinted JSON editor, browser HMAC SHA-256 signing, three-step delivery timeline, tabbed response inspector, and retryable recent deliveries.

import { WebhookTester } from '@uthereal/ui/webhook-tester'

Webhook tester playground

Webhook tester

Signed test events from Stripe

Test mode
Event
Event type
SecretHidden
Valid JSON·327 bytes
to send
  1. SignedHMAC SHA-256
  2. SentPOST
  3. 200 OK184 ms
{
  "received": true
}

Recent deliveries

2 failed
Loading interactive preview…

Overview

WebhookTester provides a self-contained Test endpoint card for products that deliver signed webhooks. On the request side, developers enter an https:// (or http://localhost) endpoint URL, choose an event type to seed the syntax-tinted JSON payload editor, optionally reveal or copy the signing secret, format valid JSON, and send a test event.

Pressing Send test event (or Mod+Enter) computes a real HMAC SHA-256 signature over ${timestamp}.${body} using Web Crypto, advances the three-step request timeline (Signed → Sent → status), displays the response body, headers, and exact signed HTTP request in a tabbed inspector, and prepends the attempt to Recent deliveries with a one-click Retry control on failed or timed-out rows.

Use WebhookTester on developer settings pages, integration onboarding flows, and internal replay tools. For managing environment secrets across Deployment stages, use Environment variables. For third-party OAuth connections and sync schedules, use Integrations.

Usage

'use client'
import { WebhookTester } from '@uthereal/ui/webhook-tester'

export function EndpointTest({
  endpointId,
  signingSecret,
}: {
  endpointId: string
  signingSecret: string
}) {
  return (
    <WebhookTester
      defaultEndpoint="https://api.acme.example/webhooks/billing"
      secret={signingSecret}
      sourceName="Acme"
      signatureHeader="x-acme-signature"
      onSend={async (request, signal) => {
        const res = await fetch(`/api/endpoints/${endpointId}/test`, {
          method: 'POST',
          headers: { 'content-type': 'application/json' },
          body: JSON.stringify(request),
          signal,
        })
        return res.json()
      }}
    />
  )
}

Omit onSend to run the built-in local simulator (nothing leaves the browser: localhost endpoints simulate a refused connection, and all other valid URLs return 200 OK with realistic latencies). Never post directly from the browser to a customer webhook URL—forward request through your backend so your server performs the real POST.

Examples

Custom provider and events

Replace sourceName, signatureHeader, events, and defaultDeliveries to match any product’s webhook format, such as CI deployment hooks with a 422 Unprocessable failure ready to retry.

Webhook tester

Signed test events from Northwind CI

Test mode
Event
Event type
SecretHidden
Valid JSON·207 bytes
to send
  1. SignedHMAC SHA-256
  2. SentPOST
  3. 422 Unprocessable148 ms
{
  "error": "invalid_schema",
  "message": "Missing required field \"commit\" in deploy payload"
}

Recent deliveries

1 failed

Fresh endpoint onboarding

Pass an empty defaultDeliveries array for a newly created endpoint awaiting its first test event, or point defaultEndpoint at http://localhost to test the local refusal error state.

Webhook tester

Signed test events from Acme Billing

Test mode
Event
Event type
SecretHidden
Valid JSON·327 bytes
to send
  1. SignHMAC SHA-256
  2. SendPOST
  3. ResponseNot sent yet
No deliveries yetSend a test event to see the response here.

Recent deliveries

0 failed
Deliveries show up here after the first test event.

Signing and delivery lifecycle

Request timeline stages

StageMetaStates
SignHMAC SHA-256Signs ${timestamp}.${body} with Web Crypto (crypto.subtle) and formats t=...,v1=.... Falls back to a deterministic 64-hex placeholder where Web Crypto is unavailable.
SendPOSTPasses the signed WebhookTestRequest and AbortSignal to onSend (or local simulation).
ResponseLatencyDisplays HTTP status (200 OK, 500 Server error), Timed out, or Unreachable with formatted duration.

Response inspector tabs

TabContentCopy output
BodySyntax-tinted JSON response body, empty-body placeholder, or network failure reason.Raw response body text or error message.
HeadersStatus line (HTTP/1.1 200 OK) followed by each response header key and value.Status line and name: value header lines.
RequestExact signed POST line, host, request headers (including signature), and body.Full HTTP request transcript ready for support tickets.

The signing secret stays masked and omitted from SSR and initial DOM markup until the reader activates the reveal toggle, preventing accidental secret leakage in server-rendered HTML.

API reference

These serializable arguments and defaults come directly from the component schema.

ArgumentType / defaultDescription
defaultEndpointstringDefault: "https://api.northwind.dev/webhooks/stripe"Initial endpoint URL, https or http on localhost. Edits do not reset a mounted instance.
eventsWebhookEventTemplate[]Default: [{"type":"invoice.paid","payload":{"id":"evt_1QhT8sKZ3v2Lw9Xc","type":"invoice.paid","created":1793111528,"livemode":false,"data":{"object":{"id":"in_1QhT8rKZ3v2Lw9Xc","customer":"cus_RkN4b7TzqP1m","amount_paid":4900,"currency":"usd","status":"paid","hosted_invoice_url":null}}}},{"type":"customer.created","payload":{"id":"evt_1QhT2aKZ3v2Lw4Rn","type":"customer.created","created":1793111528,"livemode":false,"data":{"object":{"id":"cus_RkN4b7TzqP1m","email":"maya.okafor@lumen.studio","name":"Maya Okafor","currency":"usd","delinquent":false}}}},{"type":"customer.subscription.updated","payload":{"id":"evt_1QhSz4KZ3v2Lw8Jd","type":"customer.subscription.updated","created":1793111528,"livemode":false,"data":{"object":{"id":"sub_1QhSz3KZ3v2Lw8Jd","customer":"cus_RkN4b7TzqP1m","status":"active","plan":"team_annual","quantity":12,"cancel_at_period_end":false}}}},{"type":"checkout.session.completed","payload":{"id":"evt_1QhSq9KZ3v2Lw1Te","type":"checkout.session.completed","created":1793111528,"livemode":false,"data":{"object":{"id":"cs_test_a1Kq8ZpR2vN7","customer":"cus_RkN4b7TzqP1m","amount_total":58800,"currency":"usd","payment_status":"paid","mode":"subscription"}}}},{"type":"payment_intent.payment_failed","payload":{"id":"evt_1QhSk2KZ3v2Lw6Wb","type":"payment_intent.payment_failed","created":1793111528,"livemode":false,"data":{"object":{"id":"pi_3QhSk1KZ3v2Lw6Wb","amount":4900,"currency":"usd","last_payment_error":{"code":"card_declined","decline_code":"insufficient_funds"}}}}}]Event types in the selector, each with its default JSON payload. Defaults to five Stripe-style sample events.
defaultEventstring—Event selected on first render. Defaults to the first event in the list.
secretstringDefault: "whsec_demo_9f8e7d6c5b4a3210"The signing secret. Payloads are signed with real HMAC SHA-256 in the browser via Web Crypto.
signatureHeaderstringDefault: "stripe-signature"Header that carries the t=...,v1=... signature. Defaults to stripe-signature.
sourceNamestringDefault: "Stripe"Who sends the events, shown in the subtitle beside the mark. Defaults to Stripe.
defaultDeliveriesWebhookDelivery[]Default: [{"id":"msg_2Lq8RkT4mN","event":"invoice.paid","time":"14:28:06","request":{"url":"https://api.northwind.dev/webhooks/stripe","event":"invoice.paid","body":"{\n \"id\": \"evt_1QhT8sKZ3v2Lw9Xc\",\n \"type\": \"invoice.paid\",\n \"created\": 1793111528,\n \"livemode\": false,\n \"data\": {\n \"object\": {\n \"id\": \"in_1QhT8rKZ3v2Lw9Xc\",\n \"customer\": \"cus_RkN4b7TzqP1m\",\n \"amount_paid\": 4900,\n \"currency\": \"usd\",\n \"status\": \"paid\",\n \"hosted_invoice_url\": null\n }\n }\n}","headers":{"content-type":"application/json; charset=utf-8","content-length":"327","user-agent":"UtherealWebhooks/1.0 (+https://uthereal.dev/webhooks)","stripe-signature":"t=1793111286,v1=b8f660d0e04878121828b0aac0dc7c3ae090644830d65ca8702ec094307e6050"},"timestamp":1793111286,"signature":"b8f660d0e04878121828b0aac0dc7c3ae090644830d65ca8702ec094307e6050"},"response":{"status":200,"durationMs":184,"body":"{\n \"received\": true\n}","headers":{"content-type":"application/json; charset=utf-8","content-length":"22","x-request-id":"req_8fK2nQ4tVw"}}},{"id":"msg_2Lp1XcV9sB","event":"customer.subscription.updated","time":"14:11:42","request":{"url":"https://api.northwind.dev/webhooks/stripe","event":"customer.subscription.updated","body":"{\n \"id\": \"evt_1QhSz4KZ3v2Lw8Jd\",\n \"type\": \"customer.subscription.updated\",\n \"created\": 1793111528,\n \"livemode\": false,\n \"data\": {\n \"object\": {\n \"id\": \"sub_1QhSz3KZ3v2Lw8Jd\",\n \"customer\": \"cus_RkN4b7TzqP1m\",\n \"status\": \"active\",\n \"plan\": \"team_annual\",\n \"quantity\": 12,\n \"cancel_at_period_end\": false\n }\n }\n}","headers":{"content-type":"application/json; charset=utf-8","content-length":"349","user-agent":"UtherealWebhooks/1.0 (+https://uthereal.dev/webhooks)","stripe-signature":"t=1793110302,v1=b8f6600e8062981218280c8aa0347c3ae00a84eed0d65ca8088e2c7c307e6006"},"timestamp":1793110302,"signature":"b8f6600e8062981218280c8aa0347c3ae00a84eed0d65ca8088e2c7c307e6006"},"response":{"status":500,"durationMs":1204,"body":"{\n \"error\": \"Cannot read properties of undefined (reading 'plan')\"\n}","headers":{"content-type":"application/json; charset=utf-8","content-length":"69","x-request-id":"req_3Hd7pLm2Qa","x-simulated-error":"FUNCTION_INVOCATION_FAILED"}}},{"id":"msg_2Ln7GhD3wE","event":"customer.created","time":"13:57:19","request":{"url":"https://api.northwind.dev/webhooks/stripe","event":"customer.created","body":"{\n \"id\": \"evt_1QhT2aKZ3v2Lw4Rn\",\n \"type\": \"customer.created\",\n \"created\": 1793111528,\n \"livemode\": false,\n \"data\": {\n \"object\": {\n \"id\": \"cus_RkN4b7TzqP1m\",\n \"email\": \"maya.okafor@lumen.studio\",\n \"name\": \"Maya Okafor\",\n \"currency\": \"usd\",\n \"delinquent\": false\n }\n }\n}","headers":{"content-type":"application/json; charset=utf-8","content-length":"304","user-agent":"UtherealWebhooks/1.0 (+https://uthereal.dev/webhooks)","stripe-signature":"t=1793109439,v1=b8f66062904654121828a4b0c07a7c3ae0e6d04a90d65ca828f0c4b6307e606a"},"timestamp":1793109439,"signature":"b8f66062904654121828a4b0c07a7c3ae0e6d04a90d65ca828f0c4b6307e606a"},"response":{"status":200,"durationMs":96,"body":"{\n \"received\": true\n}","headers":{"content-type":"application/json; charset=utf-8","content-length":"22","x-request-id":"req_6Tz1cRb8Nk"}}},{"id":"msg_2Lm4JkP8yR","event":"payment_intent.payment_failed","time":"13:40:03","request":{"url":"https://api.northwind.dev/webhooks/stripe","event":"payment_intent.payment_failed","body":"{\n \"id\": \"evt_1QhSk2KZ3v2Lw6Wb\",\n \"type\": \"payment_intent.payment_failed\",\n \"created\": 1793111528,\n \"livemode\": false,\n \"data\": {\n \"object\": {\n \"id\": \"pi_3QhSk1KZ3v2Lw6Wb\",\n \"amount\": 4900,\n \"currency\": \"usd\",\n \"last_payment_error\": {\n \"code\": \"card_declined\",\n \"decline_code\": \"insufficient_funds\"\n }\n }\n }\n}","headers":{"content-type":"application/json; charset=utf-8","content-length":"360","user-agent":"UtherealWebhooks/1.0 (+https://uthereal.dev/webhooks)","stripe-signature":"t=1793108403,v1=b8f660986000b8121828f02a00947c3ae058e40070d65ca8b0ae005c307e6018"},"timestamp":1793108403,"signature":"b8f660986000b8121828f02a00947c3ae058e40070d65ca8b0ae005c307e6018"},"response":{"status":0,"durationMs":10000,"timedOut":true,"error":"No response after 10 s. Return a 2xx before doing slow work."}},{"id":"msg_2Lk9MnQ2zT","event":"checkout.session.completed","time":"13:22:51","request":{"url":"https://api.northwind.dev/webhooks/stripe","event":"checkout.session.completed","body":"{\n \"id\": \"evt_1QhSq9KZ3v2Lw1Te\",\n \"type\": \"checkout.session.completed\",\n \"created\": 1793111528,\n \"livemode\": false,\n \"data\": {\n \"object\": {\n \"id\": \"cs_test_a1Kq8ZpR2vN7\",\n \"customer\": \"cus_RkN4b7TzqP1m\",\n \"amount_total\": 58800,\n \"currency\": \"usd\",\n \"payment_status\": \"paid\",\n \"mode\": \"subscription\"\n }\n }\n}","headers":{"content-type":"application/json; charset=utf-8","content-length":"348","user-agent":"UtherealWebhooks/1.0 (+https://uthereal.dev/webhooks)","stripe-signature":"t=1793107371,v1=b8f660fe3014e01218289c94f0a87c3ae03af8dc60d65ca8d85cb828307e6076"},"timestamp":1793107371,"signature":"b8f660fe3014e01218289c94f0a87c3ae03af8dc60d65ca8d85cb828307e6076"},"response":{"status":200,"durationMs":212,"body":"{\n \"received\": true\n}","headers":{"content-type":"application/json; charset=utf-8","content-length":"22","x-request-id":"req_2Wq5vYx7Je"}}}]Deliveries shown on first render, newest first. Defaults to a five-row sample with one failure and one timeout.
autoPlaybooleanDefault: falseSend one sample event when the card first scrolls into view. Opt-in demo behavior; never fires when onSend is wired.
sendActionstring—Registered host action requested when Send test event is pressed.
retryActionstring—Registered host action requested when Retry is pressed on a failed delivery.
recipestudio | softDefault: "studio"Visual treatment. Both recipes preserve interaction behavior.
themeWebhookTesterThemeDefault: {}Color mode, accent, and typed semantic token overrides.
motionnone | subtle | expressiveDefault: "subtle"Animation preset. System reduced-motion preferences take precedence.
motionOptionsWebhookTesterMotionOptionsDefault: {}Timeline crossfade and delivery row reflow timing overrides in milliseconds.
dirltr | rtl—Reading direction; inherited from the page when omitted.
  • WebhookEventTemplate accepts { type: string, payload?: JsonValue }. Event types must be unique.
  • WebhookDelivery accepts { id, event, time, request, response? }, where request is { url, event, body, headers, timestamp, signature } and response is { status, durationMs, headers?, body?, error?, timedOut? }.

React integration

PropPurpose
onEndpointChange(url)Called on every edit to the endpoint URL field.
onSend(request, signal)Sends the signed request through your backend and resolves with a WebhookTestResponse (use status: 0 and error when unreachable).
onRetry(delivery, signal)Re-sends a failed delivery with a fresh timestamp and signature. Defaults to calling onSend with the re-signed request.
onAction(action, itemId?)Called with sendAction on send or retryAction (plus the delivery ID) on retry.
renderSourceMark()Replaces the default 16px monogram mark beside the source subtitle. Keep returned elements decorative.
portalContainerPortal target forwarded to the event type selector.
presetApplication defaults overridden by explicit instance arguments.
tokensCSS variables applied after the typed theme, forwarded to the root card and portalled event selector.
ref, className, styleApplied to the root <section> element.
Native attributesid, aria-*, data-*, and remaining <section> props forwarded to the root element.

Keyboard & accessibility

KeyAction
Mod+EnterSends the test event from the payload editor or endpoint URL field (Enter alone also sends in Endpoint).
Enter (in editor)Inserts a newline matching current indentation and indents two spaces after { or [.
ArrowLeft / ArrowRightMoves between the Body, Headers, and Request tabs (respects RTL).
Home / EndJumps to the first or last response inspector tab.
TabMoves across Endpoint, Event, Reveal, Copy, Payload editor, Format, Send, Tabs, Copy, Panel, and Rows.
  • Every field carries an explicit accessible label; the payload <textarea> is labelled with the active event type, sets aria-invalid on parse errors, and highlights the failing line number in the gutter and footer.
  • The reveal toggle uses aria-pressed and updates its label between "Reveal signing secret" and "Hide signing secret". Unrevealed secrets are omitted from the DOM and announced as "Hidden".
  • Response tabs follow the WAI-ARIA tabs pattern with roving tabIndex, and the response panel is keyboard-scrollable (tabIndex={0}).
  • Delivery rows announce event name, status, and timestamp, mark the active delivery with aria-current, and pair every status chip with an icon and label rather than color alone.
  • A pre-mounted polite role="status" live region announces each send and outcome (appending "Simulated, nothing was sent." when onSend is omitted).
  • Container queries split the card into two side-by-side columns at 680px and stack below it; below 420px, delivery timestamps hide and long event names truncate cleanly. Code surfaces stay dir="ltr" while surrounding layout mirrors cleanly in RTL (dir="rtl").

Motion & theming

The timeline connectors fill along the inline axis while a traveling dot loops on the active leg until the response settles. Status icons, labels, hints, and response panels crossfade in fixed grid slots so nothing shifts, and new deliveries fade in while older rows glide down on the snappy spring (260ms).

Under prefers-reduced-motion: reduce, the traveling dot, connector fill, row reflow, and scale/travel animations turn off, swaps fall back to 120ms opacity crossfades, and the in-flight spinner slows to 1.6s. Setting motion="none" makes every transition immediate (0ms) and stops spinner animation.

theme accepts mode, accent, and typed tokens across these groups:

Token groupCSS custom properties
core--ui-surface, --ui-surface-raised, --ui-text, --ui-text-secondary, --ui-muted, --ui-border, --ui-highlight, --ui-accent, --ui-accent-foreground, --ui-danger, --ui-focus-ring, --ui-radius, --ui-border-width, --ui-shadow, --ui-disabled-opacity, --ui-font, --ui-font-size, --ui-font-weight
extended--ui-surface-sunken, --ui-border-strong, --ui-border-subtle, --ui-track, --ui-info, --ui-success, --ui-warning, --ui-tone-foreground, --ui-overlay, --ui-tint-strength
shape--ui-radius-sm, --ui-popup-radius, --ui-surface-radius
accentTones--ui-accent-strong, --ui-accent-subtle
control--ui-control-height, --ui-control-padding-x, --ui-control-gap, --ui-icon-size
type--ui-font-mono, --ui-font-display
include--ui-series-1, --ui-series-2, --ui-series-3 (JSON syntax key, literal, and number tints)

An application-wide UtherealProvider supplies defaults.

Composition

In an agent composition, WebhookTester is a leaf block. Provide placeholder endpoints and secrets only, define unique events, and wire sendAction and retryAction to registered host actions. See Building with agents.

{
  "type": "WebhookTester",
  "props": {
    "defaultEndpoint": "https://api.northwind.dev/webhooks/stripe",
    "sourceName": "Stripe",
    "signatureHeader": "stripe-signature",
    "sendAction": "send_webhook_test",
    "retryAction": "retry_webhook_delivery"
  },
  "children": []
}

On this page