webhooks.stripe() verifies the HMAC-SHA256 signature Stripe sends in stripe-signature on every request.
/trigger/stripe.ts
Set up Stripe
- Start
trigger devor deploy, then copy the endpoint’s Webhook URL from the Webhooks page. - In the Stripe Dashboard, open the Webhooks tab in Workbench and choose Create an event destination. Choose the Snapshot payload format, select the events you want, choose Webhook endpoint and paste the Webhook URL.
- On the destination’s settings page, choose Reveal secret and copy the signing secret.
- Choose Set signing secret on the Trigger.dev endpoint and paste the secret.
- Use a test mode destination for dev and staging environments and a live mode destination for production. Each has its own signing secret.
secret field is the signing secret:
Test locally
Your dev environment has its own Webhook URL, so you don’t needstripe listen or a tunnel. With trigger dev running and a test mode destination pointing at the dev URL, send a test event with the Stripe CLI:
Typing the event
webhooks.stripe() provides a default event shape. For the full Stripe types, install the stripe package and pass Stripe.Event:
/trigger/stripe.ts
Handle Stripe webhooks in your own route
If you already receive Stripe webhooks in your app, verify them withstripe.webhooks.constructEvent() and trigger a task from the route with tasks.trigger(). See Use your own webhook handler for a Next.js example.
Next steps
Filters
Run each subscriber only for the Stripe events it handles.
Waiters
Pause a run until a matching Stripe event arrives.

