source tells Trigger.dev how to verify a provider’s requests and what type the event has. Use a built-in provider, such as webhooks.stripe() or webhooks.firecrawl(), or describe the provider’s scheme with webhooks.custom().
Presets
Presets supply the verification configuration, and most also carry the provider’s part of the endpoint’s setup prompt. Set the endpoint’s signing secret or public key as described in Connect a provider.stripe(), github(), svix(), standardWebhooks(), square(), and discord().
Svix and Standard Webhooks
svix() and standardWebhooks() use HMAC-SHA256 over id.timestamp.body with a base64-encoded whsec_ secret. Their header names differ:
Named sources such as
webhooks.clerk() and webhooks.openai() select the corresponding configuration.
Named providers
More than 40 named providers, such aswebhooks.firecrawl(), webhooks.linear() and webhooks.hookdeck(), build on the same verifiers. Providers lists every one, with where to register the URL and set the signing secret.
Custom providers
For a provider without a built-in source, describe its signature scheme withwebhooks.custom(). See Custom providers for the verification schemes and options.
Endpoint validation
Some sources also define a response for the provider’s endpoint-validation request. These requests don’t create deliveries or task runs.discord() answers a verified { type: 0 } PING with HTTP 204 and no body. It also returns 204 for accepted events and 401 for invalid signatures. Set the Discord application’s public key as the endpoint’s verification credential.
Slack’s url_verification challenge is handled the same way by @trigger.dev/slack.
notion() handles Notion’s verification request, which is not signed: when you create a subscription, Notion sends a verification_token that it then uses to sign every later delivery. While the endpoint has no signing secret, the endpoint answers that request with 200 and stores the token as its signing secret. The endpoint page shows the token so you can paste it into Notion’s Verify dialog. If the token doesn’t arrive, select Resend token in that dialog. Deploy the endpoint and leave its signing secret unset before you create the subscription. Once a secret is set, a later verification request is rejected like any unsigned delivery. Before you re-create the subscription or resend its token, select Clear signing secret on the endpoint page so the endpoint stores the new token.
whatsapp() answers Meta’s GET verification request when hub.mode is subscribe and hub.verify_token matches the endpoint’s verify token. It returns hub.challenge as text. The verify token is separate from the App Secret used to verify event signatures; see Verify a WhatsApp endpoint URL. Endpoints without GET verification return 405 to GET requests.
Typing the event
Stripe and GitHub sources provide default event shapes; other sources default tounknown. Pass an event type to the source function for typed handler parameters and autocomplete. This example uses Stripe.Event from the stripe package, which must be installed in your project:
/trigger/stripe.ts
webhooks.custom<T>(), pass your own event type as T. The endpoint’s event type flows to every subscriber: webhook() handlers, chat.event keys and filters, and waiter match paths are all checked against it.
Event types are compile-time annotations. Signature verification doesn’t validate the body against
a TypeScript type. Validate
event inside onEvent if your handler needs runtime schema checks.How verification works
Requests must pass verification before they reach any subscriber. Sources can check a signature or credential, enforce a timestamp tolerance, and derive an idempotency key for deduplication. Verification failures return the source’s rejected HTTP status (400 by default).
To verify a provider that isn’t built in, choose a scheme for a custom provider.
