Webhook URL Input

Webhook URL Input is a copy-paste React component that stops webhooks pointed at localhost before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/webhook-url-input
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsWebhooks pointed at localhost

Was this component page useful?

How do I install Webhook URL Input?

pnpm dlx shadcn@latest add @bollard/webhook-url-input

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

How do I use Webhook URL Input in React?

webhook-url-input-usage.tsx
import { WebhookUrlInput } from "@/components/ui/webhook-url-input"

<WebhookUrlInput
  label="Live endpoint"
  environment="production"
  previousValue="https://api.acme.in/webhooks/stripe"
  defaultValue="https://3f2a-49-36-112-8.ngrok-free.app/webhooks/stripe"
/>

What input mistakes does Webhook URL Input catch?

  • Tunnel, localhost, private-IP and cloud-metadata hosts (error in production, hint in test)
  • Public request inspectors where anyone can read the payloads
  • Staging hosts saved to production
  • Plain http and a missing path, with fixes
  • Edits that only change www or a trailing slash, with a one-tap revert

What props does Webhook URL Input accept?

WebhookUrlInput props
PropTypeDefault
label

Visible label.

string"Endpoint URL"
value

Controlled URL text.

string—
defaultValue

Initial URL text when uncontrolled.

string""
onValueChange

Called with the URL on every change, including fixes.

(value: string) => void—
environment

Where this endpoint delivers. Tunnels and private hosts are errors in production, hints in test.

WebhookEnvironment"production"
previousValue

The URL saved last time. A change is shown as a diff, with a one-tap revert.

string—
delay

Pause in ms before notes appear while typing. Leaving the field shows them at once.

number500
environmentLabels

Badge text per environment.

Record<WebhookEnvironment, string>{ production: "Production", test: "Test mode" }
savedLabel

Label before the last saved URL.

string"Saved"
fixLabels

Fix button labels, by the kind of note they fix.

Partial<Record<WebhookUrlNote["kind"], string>>—
formatNote

Rewrites a note's message, e.g. to translate it.

(note: WebhookUrlNote) => string(n) => n.message

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

How is Webhook URL Input accessible?

  • Visible <label>; aria-invalid on errors and notes via aria-describedby
  • Notes in a polite live region with icon and text
  • After a fix, focus returns to the input

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

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Resolve and validate webhook targets server-side (block private ranges and metadata IPs) to prevent SSRF.

  • Hostname rules only; it does not resolve DNS or send a request
  • Tunnel and inspector lists are starter sets

What expensive mistakes does Webhook URL Input stop?

Webhooks pointed at localhost

Also known as

webhook url · endpoint url · callback · ngrok · stripe webhooks · razorpay webhook · dodo payments · integrations

Field type

What dependencies does Webhook URL Input require?

Webhook URL Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameWebhook URL Input
Registry identifier@bollard/webhook-url-input
Install commandnpx shadcn@latest add @bollard/webhook-url-input
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Webhook URL Input

What form validation mistake does Webhook URL Input catch?

Webhook URL Input prevents webhooks pointed at localhost. Judges a webhook URL for the environment it's saved to and warns when an edit only changed www or a trailing slash, which senders treat as a failed redirect. Catches: Tunnel, localhost, private-IP and cloud-metadata hosts (error in production, hint in test), Public request inspectors where anyone can read the payloads, Staging hosts saved to production, Plain http and a missing path, with fixes, Edits that only change www or a trailing slash, with a one-tap revert. Limitation: validate webhook-url-input schemas on backend.

How do I install webhook-url-input with shadcn?

Run `npx shadcn@latest add @bollard/webhook-url-input`. Sources added: registry/default/webhook-url-input/webhook-url-input.tsx. Package requirements: lucide-react.

What props customize Webhook URL Input?

Webhook URL Input accepts `label`, `value`, `defaultValue`, `onValueChange`, `environment`. Configures webhook url, endpoint url, callback behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of webhook-url-input?

Hostname rules only; it does not resolve DNS or send a request. Tunnel and inspector lists are starter sets Server requirement: Resolve and validate webhook targets server-side (block private ranges and metadata IPs) to prevent SSRF.

How does Webhook URL Input meet accessibility guidelines?

Visible <label>; aria-invalid on errors and notes via aria-describedby. Notes in a polite live region with icon and text. After a fix, focus returns to the input. Minimizes errors: ngrok webhook in production, webhook url redirect.

Which components pair with Webhook URL Input?