Providers send webhooks to a public URL, but your code runs on localhost. There are three ways to close that gap. Pick by what you need: just to see the payload, a full end-to-end flow, or a provider-specific test.
1. Capture first, then replay to localhost
The quickest way to see what a provider really sends, with no installation:
- Open the Webhook Tester and copy your URL.
- Paste it into the provider's dashboard as the webhook endpoint (sandbox mode) and trigger an event.
- Inspect the headers and the raw body. Check the signature right there.
- Press Replay and send the same request to
http://localhost:3000/webhook, or switch on Forward new requests to localhost.
Forwarding runs from your browser, so it works behind any firewall or VPN, but only while the tab is open, and your local server must allow CORS from https://toolercat.com (only in development).
Good for: learning a payload, reproducing one specific event again and again, debugging signature checks.
2. A tunnel to your machine
A tunnel gives your local port a public HTTPS URL, so the provider talks to your code directly:
# ngrok
ngrok http 3000
# Cloudflare quick tunnel (no account needed)
cloudflared tunnel --url http://localhost:3000
Put the printed URL plus your path (for example https://xyz.trycloudflare.com/webhook) into the provider's dashboard. Quick-tunnel URLs change on every start, so you have to update the endpoint each time.
Good for: end-to-end tests with retries and real timing.
3. The provider's own CLI
Some providers ship a CLI that forwards their events to localhost. With Stripe:
stripe listen --forward-to localhost:4242/webhook
# in another terminal
stripe trigger payment_intent.succeeded
stripe listen prints a whsec_… signing secret for this session. Use it in your local config instead of the dashboard endpoint's secret, otherwise every signature check fails.
Debugging checklist
- Signature fails? Verify against the raw body bytes, before any JSON parsing; check you use the right secret for this endpoint and environment. See how to verify webhook signatures.
- Return 2xx fast. Save the event, answer
200, and do the slow work in a background job. Slow answers count as failures and trigger retries. - Be idempotent. Store the event ID and ignore duplicates: Stripe retries failed live-mode events for up to three days, other providers retry too.
- Expect any order.
payment.updatedcan arrive beforepayment.created. Re-read the object from the API if order matters. - Log everything in development: method, path, headers, raw body and your response.
- GitHub does not retry automatically: redeliver failed deliveries from the webhook's “Recent deliveries” tab.
Which option to choose
| Need | Use |
|---|---|
| See what the provider sends | Webhook Tester (no install) |
| Re-send the same event many times | Webhook Tester → Replay |
| Full flow with retries | Tunnel (ngrok, cloudflared) |
| Stripe events on demand | Stripe CLI |
| A test event with a valid signature | Webhook Tester → Send a signed test event |