Webhook Test

Checks a webhook URL the way the sender will before it's saved: reachability, https, redirects, slow replies and login pages.

StopsWebhook saved to an unreachable URL

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/webhook-test.json

The files land in your project. They're yours to edit.

Usage

webhook-test-usage.tsx
import { WebhookTest, type WebhookTestResponse } from "@/components/ui/webhook-test"

return <WebhookTest label="Stripe webhook URL" defaultValue="http://hooks.acme.dev/stripe" onSendTest={fakeSend} />

What it catches

  • localhost, private and link-local IPs the sender can't reach
  • Plain http
  • Missing path and temporary tunnel URLs
  • Redirects, with a switch to the final URL
  • Replies close to the sender's timeout (default 10 s)
  • 200 responses that are really login pages

Props

WebhookTest props
PropTypeDefault
label

Visible label.

string"Webhook URL"
value

Controlled URL text.

string—
defaultValue

Initial URL text when uncontrolled.

string""
onValueChange

Called with the text on every change, including one-tap fixes.

(value: string) => void—
onSendTest

Sends one test delivery, usually through your backend. Abort when the signal fires.

(url: string, signal: AbortSignal) => Promise<WebhookTestResponse>—
timeout

How long the real sender waits, in ms (GitHub: 10 s). Slow replies are flagged against it.

number10_000
sendLabel

Label of the send-test button.

string"Send test"
useUrlLabel

Label of the fix that switches to a corrected URL.

string"Use this URL"
timeoutMessage

Shown when the test didn't answer in time; `{seconds}` is filled in.

string"No reply in {seconds} s. The sender would mark this deli…
errorMessage

Shown when the sender itself failed (network error).

string"The test couldn't connect to this URL."
staleMessage

Shown over a result for a URL that has since changed.

string"URL changed since this test."

* required. Also accepts the native props of <input> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Visible <label>; status via aria-describedby in a polite live region
  • Danger notes use role=alert
  • Fix and send buttons have text labels

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

This is a UX guard rail. Enforce on the server: Validate webhook URLs server-side (resolve DNS, block private ranges) to prevent SSRF, and sign deliveries.

  • Test delivery runs through your onSendTest; results depend on where it's sent from
  • Hostname checks don't resolve DNS, so names pointing at private IPs aren't caught

Rules

Rules last verified:

Confirmed GitHub asks receivers to respond within 10 seconds. Other senders use different timeouts; set timeout. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What it stops

Webhook saved to an unreachable URL

Also known as

webhook · test webhook · send test event · endpoint · integrations · stripe · dodo payments · razorpay

Field type

Dependencies

Pairs well with