Skip to main content
webhooks.stripe() verifies the HMAC-SHA256 signature Stripe sends in stripe-signature on every request.
/trigger/stripe.ts

Set up Stripe

  1. Start trigger dev or deploy, then copy the endpoint’s Webhook URL from the Webhooks page.
  2. 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.
  3. On the destination’s settings page, choose Reveal secret and copy the signing secret.
  4. Choose Set signing secret on the Trigger.dev endpoint and paste the secret.
  5. Use a test mode destination for dev and staging environments and a live mode destination for production. Each has its own signing secret.
To create the destination from the Stripe CLI instead, the response’s secret field is the signing secret:

Test locally

Your dev environment has its own Webhook URL, so you don’t need stripe 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:
The delivery appears on the endpoint’s Deliveries tab with a link to the run it started. You can also send a sample event from the endpoint’s Test tab. See Verify the connection if nothing arrives.

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 with stripe.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.