webhooks.hookdeck() verifies requests that a Hookdeck connection forwards, so you can put Hookdeck in front of any provider.
/trigger/hookdeck.ts
Set up Hookdeck
- Start
trigger devor deploy, then copy the endpoint’s Webhook URL from the Webhooks page. - In Hookdeck, create a connection whose destination is an HTTP destination with the webhook URL. Keep the destination’s authentication on Hookdeck Signature (the default); Hookdeck only signs requests with it set.
- Copy the project’s signing secret from Settings > Secrets, then choose Set signing secret on the Trigger.dev endpoint. It is one secret for the whole project.
- Send a test event from Hookdeck, or use the endpoint’s Test tab, and check the endpoint’s Deliveries tab. See Verify the connection if nothing arrives.
Typing the event
Hookdeck forwards the original provider’s body unchanged, so pass that provider’s event type:/trigger/stripe-via-hookdeck.ts
Rotation, deduplication and header prefix
- Secret rotation: when you roll the signing secret in Hookdeck with an expiry, Hookdeck also signs each request with the previous secret in
X-Hookdeck-Signature-2, so deliveries keep verifying until you store the new secret. - Deduplication: retries dedupe on
X-Hookdeck-Eventid, which is the same on every attempt of a Hookdeck event. - Custom header prefix: if you changed the header prefix in the Hookdeck project’s settings, pass it with
webhooks.hookdeck({ headerPrefix: "x-acme" }). The prefix renames the event id header; the signature headers keep theX-Hookdeck-name.
Trigger a task through the API instead
You can also point a Hookdeck destination at the trigger task API without a hosted endpoint. Hookdeck authenticates with your API key instead of a signature, and a transformation wraps the body in thepayload field the API expects.
-
Create a destination with the URL
https://api.trigger.dev/api/v1/tasks/<task-id>/trigger, methodPOST, and Bearer token authentication using a Trigger only environment API key. -
Add a transformation:
- Create a connection from your source to that destination and transformation. Turn on authentication for the Hookdeck source, such as the provider’s signature verification: the destination’s API key only authenticates Hookdeck to Trigger.dev, so an unauthenticated source would forward anyone’s requests.
/trigger/webhook-handler.ts

