localhost. Bridge the gap with a tunnel, or skip your handler entirely and inspect payloads in a browser. Then trigger events with the CLI so you are testing real deliveries, not hand-written fixtures.
Option 1: Inspect payloads with Svix Play
For a first look at what an event contains, you do not need any code:- Open play.svix.com and copy the URL it gives you (it looks like
https://play.svix.com/in/e_...). - Register that URL as an endpoint in the dashboard under Developers > Webhooks.
- Trigger an event (see below). The payload, headers, and signature appear in the browser.
Option 2: Tunnel webhooks to your local handler
Run your handler locally and expose it:https://a1b2c3.ngrok-free.app/webhooks/flexprice) as a sandbox endpoint, and copy its signing secret into your local environment as FLEXPRICE_WEBHOOK_SECRET. Free tunnels change their hostname on every restart, so update the endpoint URL in the dashboard when that happens, or use a reserved domain.
ngrok’s local inspector at
http://127.0.0.1:4040 shows every request and lets you replay it against your handler without going back to Flexprice.Triggering real webhook events
Use a sandbox API key and the CLI to cause the events you want to test:
Run any command with
--help to see the required flags for your account. The same actions in the dashboard fire the same events.
Replaying a webhook delivery
Every attempt is stored. In the dashboard, open the endpoint, go to Logs, pick a delivery, and choose resend. This is the fastest loop when iterating on a handler: fix the code, replay the same message, repeat. The replay carries the originalsvix-id, so a dedupe check keyed on it will skip the replay; clear that entry or key on something else while testing.
Testing the signature check
A handler that verifies signatures should reject a tampered body. With the secret in hand you can produce a valid signature for any payload and confirm both paths:200. Change one character in $BODY after computing $SIG and expect 400.
Checking the webhook handler end to end
- A valid delivery returns
200in under a second - A tampered body returns
400 - Replaying the same delivery does not duplicate a side effect
- An event type you do not handle still returns
200 - The dashboard Logs tab shows the attempt as successful

