@trigger.dev/sdk 4.8.5 → 4.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/v3/ai.d.ts +34 -8
- package/dist/commonjs/v3/ai.js +304 -168
- package/dist/commonjs/v3/ai.js.map +1 -1
- package/dist/commonjs/v3/auth.d.ts +4 -4
- package/dist/commonjs/v3/auth.js +21 -75
- package/dist/commonjs/v3/auth.js.map +1 -1
- package/dist/commonjs/v3/chat-client.d.ts +1 -1
- package/dist/commonjs/v3/chat.d.ts +1 -1
- package/dist/commonjs/v3/prompt.js +6 -8
- package/dist/commonjs/v3/prompt.js.map +1 -1
- package/dist/commonjs/v3/runs.d.ts +5 -1
- package/dist/commonjs/v3/runs.js.map +1 -1
- package/dist/commonjs/v3/sessions.js +10 -7
- package/dist/commonjs/v3/sessions.js.map +1 -1
- package/dist/commonjs/v3/shared.d.ts +2 -2
- package/dist/commonjs/v3/shared.js +16 -15
- package/dist/commonjs/v3/shared.js.map +1 -1
- package/dist/commonjs/v3/steeringContext.d.ts +35 -10
- package/dist/commonjs/v3/steeringContext.js +86 -14
- package/dist/commonjs/v3/steeringContext.js.map +1 -1
- package/dist/commonjs/v3/streams.js +10 -8
- package/dist/commonjs/v3/streams.js.map +1 -1
- package/dist/commonjs/v3/tasks.d.ts +2 -2
- package/dist/commonjs/v3/tasks.js.map +1 -1
- package/dist/commonjs/v3/test/mock-chat-agent.js +24 -13
- package/dist/commonjs/v3/test/mock-chat-agent.js.map +1 -1
- package/dist/commonjs/v3/toolOutputJson.d.ts +17 -0
- package/dist/commonjs/v3/toolOutputJson.js +241 -0
- package/dist/commonjs/v3/toolOutputJson.js.map +1 -0
- package/dist/commonjs/v3/webhooks.d.ts +8 -2
- package/dist/commonjs/v3/webhooks.js +20 -11
- package/dist/commonjs/v3/webhooks.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/ai.d.ts +34 -8
- package/dist/esm/v3/ai.js +306 -171
- package/dist/esm/v3/ai.js.map +1 -1
- package/dist/esm/v3/auth.d.ts +4 -4
- package/dist/esm/v3/auth.js +22 -76
- package/dist/esm/v3/auth.js.map +1 -1
- package/dist/esm/v3/chat-client.d.ts +1 -1
- package/dist/esm/v3/chat.d.ts +1 -1
- package/dist/esm/v3/prompt.js +6 -8
- package/dist/esm/v3/prompt.js.map +1 -1
- package/dist/esm/v3/runs.d.ts +5 -1
- package/dist/esm/v3/runs.js.map +1 -1
- package/dist/esm/v3/sessions.js +10 -7
- package/dist/esm/v3/sessions.js.map +1 -1
- package/dist/esm/v3/shared.d.ts +2 -2
- package/dist/esm/v3/shared.js +16 -15
- package/dist/esm/v3/shared.js.map +1 -1
- package/dist/esm/v3/steeringContext.d.ts +35 -10
- package/dist/esm/v3/steeringContext.js +85 -14
- package/dist/esm/v3/steeringContext.js.map +1 -1
- package/dist/esm/v3/streams.js +10 -8
- package/dist/esm/v3/streams.js.map +1 -1
- package/dist/esm/v3/tasks.d.ts +2 -2
- package/dist/esm/v3/tasks.js.map +1 -1
- package/dist/esm/v3/test/mock-chat-agent.js +25 -14
- package/dist/esm/v3/test/mock-chat-agent.js.map +1 -1
- package/dist/esm/v3/toolOutputJson.d.ts +17 -0
- package/dist/esm/v3/toolOutputJson.js +238 -0
- package/dist/esm/v3/toolOutputJson.js.map +1 -0
- package/dist/esm/v3/webhooks.d.ts +8 -2
- package/dist/esm/v3/webhooks.js +20 -11
- package/dist/esm/v3/webhooks.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai/observability.mdx +25 -19
- package/docs/ai/prompts.mdx +25 -19
- package/docs/ai-chat/actions.mdx +1 -1
- package/docs/ai-chat/anatomy.mdx +1 -1
- package/docs/ai-chat/backend.mdx +24 -24
- package/docs/ai-chat/background-injection.mdx +5 -5
- package/docs/ai-chat/chat-local.mdx +2 -2
- package/docs/ai-chat/compaction.mdx +47 -18
- package/docs/ai-chat/custom-agents.mdx +4 -4
- package/docs/ai-chat/error-handling.mdx +4 -4
- package/docs/ai-chat/fast-starts.mdx +8 -7
- package/docs/ai-chat/frontend.mdx +6 -2
- package/docs/ai-chat/lifecycle-hooks.mdx +11 -11
- package/docs/ai-chat/migrating-from-a-route-handler.mdx +4 -4
- package/docs/ai-chat/migrating-from-hydrate-messages.mdx +1 -1
- package/docs/ai-chat/overview.mdx +1 -1
- package/docs/ai-chat/patterns/branching-conversations.mdx +1 -1
- package/docs/ai-chat/patterns/database-persistence.mdx +2 -2
- package/docs/ai-chat/patterns/human-in-the-loop.mdx +1 -1
- package/docs/ai-chat/patterns/native-compaction.mdx +29 -9
- package/docs/ai-chat/patterns/persistence-and-replay.mdx +1 -1
- package/docs/ai-chat/patterns/redacting-telemetry.mdx +2 -2
- package/docs/ai-chat/patterns/skills.mdx +2 -2
- package/docs/ai-chat/patterns/sub-agents.mdx +1 -1
- package/docs/ai-chat/patterns/tool-result-auditing.mdx +1 -1
- package/docs/ai-chat/patterns/trusted-edge-signals.mdx +2 -2
- package/docs/ai-chat/patterns/version-upgrades.mdx +2 -2
- package/docs/ai-chat/pending-messages.mdx +5 -5
- package/docs/ai-chat/prompt-caching.mdx +7 -7
- package/docs/ai-chat/quick-start.mdx +2 -2
- package/docs/ai-chat/testing.mdx +9 -9
- package/docs/ai-chat/tools.mdx +9 -5
- package/docs/ai-chat/transcript-storage.mdx +2 -2
- package/docs/ai-chat/types.mdx +10 -3
- package/docs/apikeys.mdx +2 -1
- package/docs/cli-login-commands.mdx +12 -0
- package/docs/concurrency.mdx +40 -0
- package/docs/database-connections.mdx +1 -1
- package/docs/deploy-environment-variables.mdx +84 -2
- package/docs/deployment/trusted-publishing.mdx +4 -0
- package/docs/errors-retrying.mdx +25 -18
- package/docs/github-actions.mdx +1 -1
- package/docs/github-integration.mdx +32 -1
- package/docs/how-it-works.mdx +4 -2
- package/docs/introduction.mdx +1 -1
- package/docs/mcp-introduction.mdx +7 -1
- package/docs/mcp-remote.mdx +90 -0
- package/docs/oidc/azure.mdx +81 -0
- package/docs/oidc/databricks.mdx +99 -0
- package/docs/oidc/doppler.mdx +60 -0
- package/docs/oidc/gcp.mdx +109 -0
- package/docs/oidc/hugging-face.mdx +90 -0
- package/docs/oidc/openrouter.mdx +91 -0
- package/docs/oidc/snowflake.mdx +91 -0
- package/docs/oidc/vault.mdx +71 -0
- package/docs/oidc.mdx +2 -0
- package/docs/runs/metadata.mdx +1 -1
- package/docs/self-hosting/docker.mdx +2 -0
- package/docs/self-hosting/env/webapp.mdx +4 -1
- package/docs/self-hosting/kubernetes.mdx +2 -0
- package/docs/tasks/schemaTask.mdx +26 -13
- package/docs/tasks/streams.mdx +2 -2
- package/docs/troubleshooting.mdx +7 -0
- package/docs/webhooks/channels.mdx +6 -6
- package/docs/webhooks/connect.mdx +9 -75
- package/docs/webhooks/custom-providers.mdx +87 -0
- package/docs/webhooks/deliveries.mdx +7 -7
- package/docs/webhooks/filters.mdx +2 -2
- package/docs/webhooks/how-it-works.mdx +58 -0
- package/docs/webhooks/human-in-the-loop.mdx +3 -3
- package/docs/webhooks/linear.mdx +5 -3
- package/docs/webhooks/overview.mdx +20 -71
- package/docs/webhooks/own-handler.mdx +62 -0
- package/docs/webhooks/pricing-and-limits.mdx +13 -0
- package/docs/webhooks/providers/attio.mdx +38 -0
- package/docs/webhooks/providers/autumn.mdx +40 -0
- package/docs/webhooks/providers/cal-com.mdx +41 -0
- package/docs/webhooks/providers/calendly.mdx +41 -0
- package/docs/webhooks/providers/clerk.mdx +40 -0
- package/docs/webhooks/providers/discord.mdx +45 -0
- package/docs/webhooks/providers/docusign.mdx +41 -0
- package/docs/webhooks/providers/elevenlabs.mdx +41 -0
- package/docs/webhooks/providers/firecrawl.mdx +54 -0
- package/docs/webhooks/providers/github.mdx +46 -0
- package/docs/webhooks/providers/gitlab.mdx +41 -0
- package/docs/webhooks/providers/granola.mdx +44 -0
- package/docs/webhooks/providers/hookdeck.mdx +98 -0
- package/docs/webhooks/providers/infisical.mdx +41 -0
- package/docs/webhooks/providers/jira.mdx +41 -0
- package/docs/webhooks/providers/langfuse.mdx +40 -0
- package/docs/webhooks/providers/linear.mdx +45 -0
- package/docs/webhooks/providers/loops.mdx +40 -0
- package/docs/webhooks/providers/metronome.mdx +42 -0
- package/docs/webhooks/providers/mux.mdx +40 -0
- package/docs/webhooks/providers/openai.mdx +40 -0
- package/docs/webhooks/providers/pagerduty.mdx +40 -0
- package/docs/webhooks/providers/plain.mdx +41 -0
- package/docs/webhooks/providers/planetscale.mdx +40 -0
- package/docs/webhooks/providers/recall-ai.mdx +54 -0
- package/docs/webhooks/providers/replicate.mdx +41 -0
- package/docs/webhooks/providers/resend.mdx +44 -0
- package/docs/webhooks/providers/retell.mdx +41 -0
- package/docs/webhooks/providers/sentry.mdx +41 -0
- package/docs/webhooks/providers/shopify.mdx +49 -0
- package/docs/webhooks/providers/slack.mdx +48 -0
- package/docs/webhooks/providers/square.mdx +40 -0
- package/docs/webhooks/providers/stripe.mdx +86 -0
- package/docs/webhooks/providers/supabase.mdx +41 -0
- package/docs/webhooks/providers/tailscale.mdx +43 -0
- package/docs/webhooks/providers/typeform.mdx +42 -0
- package/docs/webhooks/providers/vapi.mdx +47 -0
- package/docs/webhooks/providers/vercel.mdx +40 -0
- package/docs/webhooks/providers/whatsapp.mdx +45 -0
- package/docs/webhooks/providers/workos.mdx +41 -0
- package/docs/webhooks/providers/zendesk.mdx +41 -0
- package/docs/webhooks/providers.mdx +53 -0
- package/docs/webhooks/quick-start.mdx +131 -0
- package/docs/webhooks/session-routing.mdx +6 -6
- package/docs/webhooks/signing-secrets.mdx +80 -0
- package/docs/webhooks/slack.mdx +11 -2
- package/docs/webhooks/verification.mdx +139 -0
- package/docs/webhooks/waiters.mdx +2 -2
- package/docs/webhooks/webhook-tasks.mdx +46 -0
- package/package.json +4 -5
- package/docs/migrating-from-v3.mdx +0 -332
- package/docs/webhooks/public-beta.mdx +0 -70
- package/docs/webhooks/sources.mdx +0 -252
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Shopify webhooks"
|
|
3
|
+
sidebarTitle: "Shopify"
|
|
4
|
+
description: "Receive and verify Shopify webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-shopify-hmac-sha256 and run a task for each Shopify event, filtered on header.x-shopify-topic."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.shopify()` verifies the HMAC-SHA256 signature Shopify sends in `x-shopify-hmac-sha256` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/shopify.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const shopify = webhooks.endpoint.define({
|
|
13
|
+
id: "shopify",
|
|
14
|
+
source: webhooks.shopify(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const shopifyEvents = webhook({
|
|
18
|
+
id: "shopify-events",
|
|
19
|
+
endpoint: shopify,
|
|
20
|
+
filter: "header.x-shopify-topic == 'orders/create'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.shopify()` |
|
|
30
|
+
| Verification | HMAC-SHA256 in `x-shopify-hmac-sha256` |
|
|
31
|
+
| Credential | Signing secret issued by Shopify |
|
|
32
|
+
| Event type | `header.x-shopify-topic` |
|
|
33
|
+
| Shopify docs | [Shopify webhook docs](https://shopify.dev/docs/apps/build/webhooks/verify-deliveries) |
|
|
34
|
+
|
|
35
|
+
## Set up Shopify
|
|
36
|
+
|
|
37
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
38
|
+
2. For an app, add a subscription to `shopify.app.toml` and run `shopify app deploy`:
|
|
39
|
+
|
|
40
|
+
```toml shopify.app.toml
|
|
41
|
+
[[webhooks.subscriptions]]
|
|
42
|
+
topics = ["orders/create"]
|
|
43
|
+
uri = "<webhook URL>"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or create it with the Admin API's `webhookSubscriptionCreate` mutation. Use the JSON format.
|
|
47
|
+
3. Shopify signs app webhooks with the app's client secret, which is in the app's settings in the Shopify Dev Dashboard. Choose **Set signing secret** on the Trigger.dev endpoint and paste it.
|
|
48
|
+
4. For a store without an app, add the webhook under **Settings > Notifications > Webhooks** in the store admin, and use the signing key shown on that page instead.
|
|
49
|
+
5. Send a test event from Shopify, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Slack webhooks"
|
|
3
|
+
sidebarTitle: "Slack"
|
|
4
|
+
description: "Receive and verify Slack webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-slack-signature and run a task for each Slack event, filtered on event.event.type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhookSource()` from `@trigger.dev/slack` verifies the HMAC-SHA256 signature Slack sends in `x-slack-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/slack.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
import { webhookSource } from "@trigger.dev/slack";
|
|
12
|
+
|
|
13
|
+
export const slack = webhooks.endpoint.define({
|
|
14
|
+
id: "slack",
|
|
15
|
+
source: webhookSource(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const slackEvents = webhook({
|
|
19
|
+
id: "slack-events",
|
|
20
|
+
endpoint: slack,
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
To run a subscriber only for some events, add a [filter](/webhooks/filters) on `event.event.type`.
|
|
28
|
+
|
|
29
|
+
| Setting | Value |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| Source | `webhookSource()` from `@trigger.dev/slack` |
|
|
32
|
+
| Verification | HMAC-SHA256 in `x-slack-signature`, with a timestamp tolerance |
|
|
33
|
+
| Credential | Signing secret issued by Slack |
|
|
34
|
+
| Event type | `event.event.type` |
|
|
35
|
+
| Slack docs | [Slack webhook docs](https://docs.slack.dev/authentication/verifying-requests-from-slack/) |
|
|
36
|
+
|
|
37
|
+
## Set up Slack
|
|
38
|
+
|
|
39
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
40
|
+
2. In your Slack app's settings, set the **Event Subscriptions** request URL to the webhook URL and subscribe to the bot events your subscribers need.
|
|
41
|
+
3. Copy the app's **Signing Secret** from **Basic Information > App Credentials**, then choose **Set signing secret** on the Trigger.dev endpoint.
|
|
42
|
+
4. Back on the Event Subscriptions page, choose **Retry**. Slack's `url_verification` challenge is answered by the endpoint once the secret is set.
|
|
43
|
+
5. Install the app to your workspace, or reinstall it if the bot events need new scopes. Slack only delivers events the workspace has authorized.
|
|
44
|
+
6. Send a test event from Slack, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
45
|
+
|
|
46
|
+
## Build a Slack agent
|
|
47
|
+
|
|
48
|
+
To answer messages in Slack with a `chat.agent`, use the `slack()` connector on the same endpoint. It handles streaming replies, status updates and approvals. See [Slack agents](/webhooks/slack).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Square webhooks"
|
|
3
|
+
sidebarTitle: "Square"
|
|
4
|
+
description: "Receive and verify Square webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-square-hmacsha256-signature and run a task for each Square event, filtered on event.type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.square()` verifies the HMAC-SHA256 signature Square sends in `x-square-hmacsha256-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/square.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const square = webhooks.endpoint.define({
|
|
13
|
+
id: "square",
|
|
14
|
+
source: webhooks.square(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const squareEvents = webhook({
|
|
18
|
+
id: "square-events",
|
|
19
|
+
endpoint: square,
|
|
20
|
+
filter: "event.type == 'payment.created'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.square()` |
|
|
30
|
+
| Verification | HMAC-SHA256 in `x-square-hmacsha256-signature` |
|
|
31
|
+
| Credential | Signing secret issued by Square |
|
|
32
|
+
| Event type | `event.type` |
|
|
33
|
+
| Square docs | [Square webhook docs](https://developer.squareup.com/docs/webhooks/step3validate) |
|
|
34
|
+
|
|
35
|
+
## Set up Square
|
|
36
|
+
|
|
37
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
38
|
+
2. Add the webhook URL as a webhook in Square and select the events your subscribers need. See Square's [webhook docs](https://developer.squareup.com/docs/webhooks/step3validate) for where its webhook settings are.
|
|
39
|
+
3. Copy the signing secret Square shows for the webhook, then choose **Set signing secret** on the Trigger.dev endpoint.
|
|
40
|
+
4. Send a test event from Square, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Receive and verify Stripe webhooks"
|
|
3
|
+
sidebarTitle: "Stripe"
|
|
4
|
+
description: "Verify Stripe's webhook signature and run a Trigger.dev task for each Stripe event, such as checkout.session.completed. Register the endpoint in Stripe, set the whsec_ signing secret, and filter by event type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.stripe()` verifies the HMAC-SHA256 signature Stripe sends in `stripe-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/stripe.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const stripe = webhooks.endpoint.define({
|
|
13
|
+
id: "stripe",
|
|
14
|
+
source: webhooks.stripe(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const fulfillCheckout = webhook({
|
|
18
|
+
id: "fulfill-checkout",
|
|
19
|
+
endpoint: stripe,
|
|
20
|
+
filter: "event.type == 'checkout.session.completed'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log("Checkout completed", event.data.object.id);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.stripe()` |
|
|
30
|
+
| Verification | HMAC-SHA256 in `stripe-signature`, with a timestamp tolerance |
|
|
31
|
+
| Credential | Signing secret issued by Stripe (starts with `whsec_`) |
|
|
32
|
+
| Event type | `event.type` |
|
|
33
|
+
| Stripe docs | [Stripe webhook docs](https://docs.stripe.com/webhooks) |
|
|
34
|
+
|
|
35
|
+
## Set up Stripe
|
|
36
|
+
|
|
37
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
38
|
+
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.
|
|
39
|
+
3. On the destination's settings page, choose **Reveal secret** and copy the signing secret.
|
|
40
|
+
4. Choose **Set signing secret** on the Trigger.dev endpoint and paste the secret.
|
|
41
|
+
5. Use a test mode destination for dev and staging environments and a live mode destination for production. Each has its own signing secret.
|
|
42
|
+
|
|
43
|
+
To create the destination from the Stripe CLI instead, the response's `secret` field is the signing secret:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
stripe webhook_endpoints create -d url="<webhook URL>" -d "enabled_events[]=checkout.session.completed"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Test locally
|
|
50
|
+
|
|
51
|
+
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:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
stripe trigger checkout.session.completed
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
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](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
58
|
+
|
|
59
|
+
## Typing the event
|
|
60
|
+
|
|
61
|
+
`webhooks.stripe()` provides a default event shape. For the full Stripe types, install the `stripe` package and pass `Stripe.Event`:
|
|
62
|
+
|
|
63
|
+
```ts /trigger/stripe.ts
|
|
64
|
+
import type Stripe from "stripe";
|
|
65
|
+
import { webhooks } from "@trigger.dev/sdk";
|
|
66
|
+
|
|
67
|
+
export const stripe = webhooks.endpoint.define({
|
|
68
|
+
id: "stripe",
|
|
69
|
+
source: webhooks.stripe<Stripe.Event>(),
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Handle Stripe webhooks in your own route
|
|
74
|
+
|
|
75
|
+
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](/webhooks/own-handler) for a Next.js example.
|
|
76
|
+
|
|
77
|
+
## Next steps
|
|
78
|
+
|
|
79
|
+
<CardGroup cols={2}>
|
|
80
|
+
<Card title="Filters" icon="filter" href="/webhooks/filters">
|
|
81
|
+
Run each subscriber only for the Stripe events it handles.
|
|
82
|
+
</Card>
|
|
83
|
+
<Card title="Waiters" icon="hourglass" href="/webhooks/waiters">
|
|
84
|
+
Pause a run until a matching Stripe event arrives.
|
|
85
|
+
</Card>
|
|
86
|
+
</CardGroup>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Supabase webhooks"
|
|
3
|
+
sidebarTitle: "Supabase"
|
|
4
|
+
description: "Receive Supabase database webhooks with Trigger.dev. Check a shared bearer secret and run a task for each insert, update or delete."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.supabase()` checks a shared secret on every request, because Supabase database webhooks aren't signed.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/supabase.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const supabase = webhooks.endpoint.define({
|
|
13
|
+
id: "supabase",
|
|
14
|
+
source: webhooks.supabase(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const supabaseEvents = webhook({
|
|
18
|
+
id: "supabase-events",
|
|
19
|
+
endpoint: supabase,
|
|
20
|
+
filter: "event.type == 'INSERT' && event.table == 'orders'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.supabase()` |
|
|
30
|
+
| Verification | Shared secret as `Authorization: Bearer` |
|
|
31
|
+
| Credential | Secret you generate on Trigger.dev |
|
|
32
|
+
| Event type | `event.type` |
|
|
33
|
+
| Supabase docs | [Supabase webhook docs](https://supabase.com/docs/guides/database/webhooks) |
|
|
34
|
+
|
|
35
|
+
## Set up Supabase
|
|
36
|
+
|
|
37
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
38
|
+
2. Choose **Generate secret** on the Trigger.dev endpoint and copy the value. Supabase database webhooks aren't signed, so the endpoint checks this shared secret instead.
|
|
39
|
+
3. On the **Database Webhooks** page of the Supabase dashboard, create a webhook on the table and events (`INSERT`, `UPDATE`, `DELETE`) your subscribers need, with type **HTTP Request**, method `POST`, and the webhook URL.
|
|
40
|
+
4. Under **HTTP Headers**, add `Authorization` with the value `Bearer <secret>`.
|
|
41
|
+
5. Insert a row into the table, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Tailscale webhooks"
|
|
3
|
+
sidebarTitle: "Tailscale"
|
|
4
|
+
description: "Receive and verify Tailscale webhooks with Trigger.dev. Check the HMAC-SHA256 signature in tailscale-webhook-signature and run a task for each Tailscale event."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.tailscale()` verifies the HMAC-SHA256 signature Tailscale sends in `tailscale-webhook-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/tailscale.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const tailscale = webhooks.endpoint.define({
|
|
13
|
+
id: "tailscale",
|
|
14
|
+
source: webhooks.tailscale(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const tailscaleEvents = webhook({
|
|
18
|
+
id: "tailscale-events",
|
|
19
|
+
endpoint: tailscale,
|
|
20
|
+
filter: "event any ( type == 'nodeCreated' )",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.tailscale()` |
|
|
30
|
+
| Verification | HMAC-SHA256 in `tailscale-webhook-signature` |
|
|
31
|
+
| Credential | Signing secret issued by Tailscale |
|
|
32
|
+
| Tailscale docs | [Tailscale webhook docs](https://tailscale.com/docs/features/webhooks) |
|
|
33
|
+
|
|
34
|
+
## Set up Tailscale
|
|
35
|
+
|
|
36
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
37
|
+
2. On the **Webhooks** page of the Tailscale admin console, select **Add endpoint**, enter the webhook URL, and choose the events your subscribers need. This needs the Owner, Admin, Network admin or IT admin role.
|
|
38
|
+
3. Tailscale shows the webhook secret once, right after the endpoint is added. Copy it then, and choose **Set signing secret** on the Trigger.dev endpoint.
|
|
39
|
+
4. Use the Tailscale endpoint's menu, **Test endpoint > Send test event**, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
40
|
+
|
|
41
|
+
## Batched events
|
|
42
|
+
|
|
43
|
+
Each request body is a JSON array of events, and Tailscale can batch several into one request. Filters match an event anywhere in the array with `event any ( ... )`, and a handler should process every event in the array.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Typeform webhooks"
|
|
3
|
+
sidebarTitle: "Typeform"
|
|
4
|
+
description: "Receive and verify Typeform webhooks with Trigger.dev. Check the HMAC-SHA256 signature in typeform-signature and run a task for each Typeform event, filtered on event.event_type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.typeform()` verifies the HMAC-SHA256 signature Typeform sends in `typeform-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/typeform.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const typeform = webhooks.endpoint.define({
|
|
13
|
+
id: "typeform",
|
|
14
|
+
source: webhooks.typeform(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const typeformEvents = webhook({
|
|
18
|
+
id: "typeform-events",
|
|
19
|
+
endpoint: typeform,
|
|
20
|
+
onEvent: async ({ event }) => {
|
|
21
|
+
console.log(event);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
To run a subscriber only for some events, add a [filter](/webhooks/filters) on `event.event_type`.
|
|
27
|
+
|
|
28
|
+
| Setting | Value |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Source | `webhooks.typeform()` |
|
|
31
|
+
| Verification | HMAC-SHA256 in `typeform-signature` |
|
|
32
|
+
| Credential | Secret you generate on Trigger.dev |
|
|
33
|
+
| Event type | `event.event_type` |
|
|
34
|
+
| Typeform docs | [Typeform webhook docs](https://www.typeform.com/developers/webhooks/secure-your-webhooks/) |
|
|
35
|
+
|
|
36
|
+
## Set up Typeform
|
|
37
|
+
|
|
38
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
39
|
+
2. Choose **Generate secret** on the Trigger.dev endpoint and copy the value.
|
|
40
|
+
3. In Typeform, open the form's **Connect > Webhooks** and add a webhook with the webhook URL. Edit it and paste the secret into **Secret**. You can also set `secret` when you create the webhook with Typeform's API.
|
|
41
|
+
4. Turn the webhook **On**. Typeform creates dashboard webhooks switched off.
|
|
42
|
+
5. Send a test event from Typeform, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Vapi webhooks"
|
|
3
|
+
sidebarTitle: "Vapi"
|
|
4
|
+
description: "Receive and verify Vapi webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-vapi-signature and run a task for each Vapi event, filtered on event.message.type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.vapi()` verifies the HMAC-SHA256 signature Vapi sends in `x-vapi-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/vapi.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const vapi = webhooks.endpoint.define({
|
|
13
|
+
id: "vapi",
|
|
14
|
+
source: webhooks.vapi(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const vapiEvents = webhook({
|
|
18
|
+
id: "vapi-events",
|
|
19
|
+
endpoint: vapi,
|
|
20
|
+
onEvent: async ({ event }) => {
|
|
21
|
+
console.log(event);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
To run a subscriber only for some events, add a [filter](/webhooks/filters) on `event.message.type`.
|
|
27
|
+
|
|
28
|
+
| Setting | Value |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Source | `webhooks.vapi()` |
|
|
31
|
+
| Verification | HMAC-SHA256 in `x-vapi-signature` |
|
|
32
|
+
| Credential | Secret you generate on Trigger.dev and add to a Vapi HMAC credential |
|
|
33
|
+
| Event type | `event.message.type` |
|
|
34
|
+
| Vapi docs | [Vapi webhook docs](https://docs.vapi.ai/server-url/server-authentication) |
|
|
35
|
+
|
|
36
|
+
## Set up Vapi
|
|
37
|
+
|
|
38
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
39
|
+
2. Choose **Generate secret** on the Trigger.dev endpoint and copy the value.
|
|
40
|
+
3. In the Vapi Dashboard, open **Integrations > Server Configuration** and choose **Add Custom Credential**. Choose **HMAC** and set:
|
|
41
|
+
- **Secret Key**: the secret you generated
|
|
42
|
+
- **Algorithm**: SHA256
|
|
43
|
+
- **Signature Header**: `x-vapi-signature`
|
|
44
|
+
- **Timestamp Header**: leave empty
|
|
45
|
+
- **Payload Format**: the request body only, with no timestamp
|
|
46
|
+
4. Set the webhook URL as the server URL on your assistant, phone number or Server Configuration, and attach the credential by its `credentialId`. Vapi only sends the credential when the server URL comes from your saved configuration, not from an API request.
|
|
47
|
+
5. Send a test event from Vapi, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Vercel webhooks"
|
|
3
|
+
sidebarTitle: "Vercel"
|
|
4
|
+
description: "Receive and verify Vercel webhooks with Trigger.dev. Check the HMAC-SHA1 signature in x-vercel-signature and run a task for each Vercel event, filtered on event.type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.vercel()` verifies the HMAC-SHA1 signature Vercel sends in `x-vercel-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/vercel.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const vercel = webhooks.endpoint.define({
|
|
13
|
+
id: "vercel",
|
|
14
|
+
source: webhooks.vercel(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const vercelEvents = webhook({
|
|
18
|
+
id: "vercel-events",
|
|
19
|
+
endpoint: vercel,
|
|
20
|
+
filter: "event.type == 'deployment.succeeded'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.vercel()` |
|
|
30
|
+
| Verification | HMAC-SHA1 in `x-vercel-signature` |
|
|
31
|
+
| Credential | Signing secret issued by Vercel |
|
|
32
|
+
| Event type | `event.type` |
|
|
33
|
+
| Vercel docs | [Vercel webhook docs](https://vercel.com/docs/webhooks) |
|
|
34
|
+
|
|
35
|
+
## Set up Vercel
|
|
36
|
+
|
|
37
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
38
|
+
2. In Vercel, open your team's **Settings > Webhooks** (Pro and Enterprise plans) and create a webhook with the webhook URL and the events your subscribers need.
|
|
39
|
+
3. Vercel shows the webhook's secret once, in the dialog after the webhook is created. Copy it then, and choose **Set signing secret** on the Trigger.dev endpoint. Webhooks from a Vercel integration are signed with the integration's Client Secret instead.
|
|
40
|
+
4. Send a test event from Vercel, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "WhatsApp webhooks"
|
|
3
|
+
sidebarTitle: "WhatsApp"
|
|
4
|
+
description: "Receive and verify WhatsApp webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-hub-signature-256 and run a task for each WhatsApp event."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.whatsapp()` verifies the HMAC-SHA256 signature WhatsApp sends in `x-hub-signature-256`, keyed by the App Secret on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/whatsapp.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const whatsapp = webhooks.endpoint.define({
|
|
13
|
+
id: "whatsapp",
|
|
14
|
+
source: webhooks.whatsapp(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const whatsappEvents = webhook({
|
|
18
|
+
id: "whatsapp-events",
|
|
19
|
+
endpoint: whatsapp,
|
|
20
|
+
onEvent: async ({ event }) => {
|
|
21
|
+
console.log(event);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Setting | Value |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| Source | `webhooks.whatsapp()` |
|
|
29
|
+
| Verification | HMAC-SHA256 in `x-hub-signature-256`, keyed by the App Secret |
|
|
30
|
+
| Credential | Signing secret issued by WhatsApp |
|
|
31
|
+
| WhatsApp docs | [WhatsApp webhook docs](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/set-up-webhooks/) |
|
|
32
|
+
|
|
33
|
+
## Set up WhatsApp
|
|
34
|
+
|
|
35
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
36
|
+
2. In the Meta app dashboard, set the WhatsApp webhook's callback URL to the webhook URL. Meta checks the URL with a GET request that needs a verify token; see [Verify the callback URL](#verify-the-callback-url).
|
|
37
|
+
3. Copy the app's **App Secret**, then choose **Set signing secret** on the Trigger.dev endpoint. Meta signs event deliveries with it.
|
|
38
|
+
4. Subscribe the webhook to the fields your subscribers need, such as `messages`.
|
|
39
|
+
5. Send a test event from WhatsApp, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
40
|
+
|
|
41
|
+
## Verify the callback URL
|
|
42
|
+
|
|
43
|
+
`webhooks.whatsapp()` also needs a verify token for Meta's URL check. On the endpoint, choose **Generate verify token** and paste the value into Meta's **Verify Token** field. Set Meta's App Secret as the signing secret, then validate the URL in Meta's dashboard.
|
|
44
|
+
|
|
45
|
+
The verify token answers the URL check. The signing secret verifies event deliveries. See [Verification](/webhooks/verification#endpoint-validation) for the response behavior.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "WorkOS webhooks"
|
|
3
|
+
sidebarTitle: "WorkOS"
|
|
4
|
+
description: "Receive and verify WorkOS webhooks with Trigger.dev. Check the HMAC-SHA256 signature in workos-signature and run a task for each WorkOS event, filtered on event.event."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.workos()` verifies the HMAC-SHA256 signature WorkOS sends in `workos-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/workos.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const workos = webhooks.endpoint.define({
|
|
13
|
+
id: "workos",
|
|
14
|
+
source: webhooks.workos(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const workosEvents = webhook({
|
|
18
|
+
id: "workos-events",
|
|
19
|
+
endpoint: workos,
|
|
20
|
+
onEvent: async ({ event }) => {
|
|
21
|
+
console.log(event);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
To run a subscriber only for some events, add a [filter](/webhooks/filters) on `event.event`.
|
|
27
|
+
|
|
28
|
+
| Setting | Value |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Source | `webhooks.workos()` |
|
|
31
|
+
| Verification | HMAC-SHA256 in `workos-signature` |
|
|
32
|
+
| Credential | Signing secret issued by WorkOS |
|
|
33
|
+
| Event type | `event.event` |
|
|
34
|
+
| WorkOS docs | [WorkOS webhook docs](https://workos.com/docs/events/data-syncing/webhooks) |
|
|
35
|
+
|
|
36
|
+
## Set up WorkOS
|
|
37
|
+
|
|
38
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
39
|
+
2. Add the webhook URL as a webhook in WorkOS and select the events your subscribers need. See WorkOS's [webhook docs](https://workos.com/docs/events/data-syncing/webhooks) for where its webhook settings are.
|
|
40
|
+
3. Copy the signing secret WorkOS shows for the webhook, then choose **Set signing secret** on the Trigger.dev endpoint.
|
|
41
|
+
4. Send a test event from WorkOS, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Zendesk webhooks"
|
|
3
|
+
sidebarTitle: "Zendesk"
|
|
4
|
+
description: "Receive and verify Zendesk webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-zendesk-webhook-signature and run a task for each Zendesk event, filtered on its event type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.zendesk()` verifies the HMAC-SHA256 signature Zendesk sends in `x-zendesk-webhook-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/zendesk.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const zendesk = webhooks.endpoint.define({
|
|
13
|
+
id: "zendesk",
|
|
14
|
+
source: webhooks.zendesk(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const zendeskEvents = webhook({
|
|
18
|
+
id: "zendesk-events",
|
|
19
|
+
endpoint: zendesk,
|
|
20
|
+
onEvent: async ({ event }) => {
|
|
21
|
+
console.log(event);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
To run a subscriber only for some events, add a [filter](/webhooks/filters) on `event.type` for Zendesk event subscriptions. For trigger and automation webhooks, you write the JSON body, so filter on a field your template sends.
|
|
27
|
+
|
|
28
|
+
| Setting | Value |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Source | `webhooks.zendesk()` |
|
|
31
|
+
| Verification | HMAC-SHA256 in `x-zendesk-webhook-signature` |
|
|
32
|
+
| Credential | Signing secret issued by Zendesk |
|
|
33
|
+
| Event type | `event.type` for event subscriptions; a field from your template for triggers and automations |
|
|
34
|
+
| Zendesk docs | [Zendesk webhook docs](https://developer.zendesk.com/documentation/webhooks/verifying/) |
|
|
35
|
+
|
|
36
|
+
## Set up Zendesk
|
|
37
|
+
|
|
38
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
39
|
+
2. In Zendesk Admin Center, open **Apps and integrations > Webhooks** and create a webhook with the webhook URL. Subscribe it to Zendesk events, or connect it to a trigger or automation.
|
|
40
|
+
3. Zendesk generates the signing secret. On the webhook's details, choose **Reveal secret**, copy it, and choose **Set signing secret** on the Trigger.dev endpoint.
|
|
41
|
+
4. Send a test event from Zendesk, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](/webhooks/connect#verify-the-connection) if nothing arrives.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Webhook providers"
|
|
3
|
+
sidebarTitle: "All providers"
|
|
4
|
+
description: "Every built-in webhook provider, with its SDK function, the credential it verifies with, and a setup page for each provider."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Each built-in provider has a source function that verifies its signature scheme, so you declare the endpoint with one function call and set one credential.** Every provider below has a page with the source, where to register the URL, and how to set the credential.
|
|
8
|
+
|
|
9
|
+
| Provider | Source | Credential |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| [Attio](/webhooks/providers/attio) | `webhooks.attio()` | Issued by the provider |
|
|
12
|
+
| [Autumn](/webhooks/providers/autumn) | `webhooks.autumn()` | Issued by the provider |
|
|
13
|
+
| [Cal.com](/webhooks/providers/cal-com) | `webhooks.calCom()` | You generate it |
|
|
14
|
+
| [Calendly](/webhooks/providers/calendly) | `webhooks.calendly()` | You choose it (OAuth apps: issued by the provider) |
|
|
15
|
+
| [Clerk](/webhooks/providers/clerk) | `webhooks.clerk()` | Issued by the provider |
|
|
16
|
+
| [Discord](/webhooks/providers/discord) | `webhooks.discord()` | Provider's public key |
|
|
17
|
+
| [DocuSign](/webhooks/providers/docusign) | `webhooks.docusign()` | Issued by the provider |
|
|
18
|
+
| [ElevenLabs](/webhooks/providers/elevenlabs) | `webhooks.elevenlabs()` | Issued by the provider |
|
|
19
|
+
| [Firecrawl](/webhooks/providers/firecrawl) | `webhooks.firecrawl()` | Issued by the provider |
|
|
20
|
+
| [GitHub](/webhooks/providers/github) | `webhooks.github()` | You generate it |
|
|
21
|
+
| [GitLab](/webhooks/providers/gitlab) | `webhooks.gitlab()` | You generate it |
|
|
22
|
+
| [Granola](/webhooks/providers/granola) | `webhooks.granola()` | Issued by the provider |
|
|
23
|
+
| [Hookdeck](/webhooks/providers/hookdeck) | `webhooks.hookdeck()` | Issued by the provider |
|
|
24
|
+
| [Infisical](/webhooks/providers/infisical) | `webhooks.infisical()` | You generate it |
|
|
25
|
+
| [Jira](/webhooks/providers/jira) | `webhooks.jira()` | You generate it |
|
|
26
|
+
| [Langfuse](/webhooks/providers/langfuse) | `webhooks.langfuse()` | Issued by the provider |
|
|
27
|
+
| [Linear](/webhooks/providers/linear) | `webhooks.linear()` | Issued by the provider |
|
|
28
|
+
| [Loops](/webhooks/providers/loops) | `webhooks.loops()` | Issued by the provider |
|
|
29
|
+
| [Metronome](/webhooks/providers/metronome) | `webhooks.metronome()` | Issued by the provider |
|
|
30
|
+
| [Mux](/webhooks/providers/mux) | `webhooks.mux()` | Issued by the provider |
|
|
31
|
+
| [OpenAI](/webhooks/providers/openai) | `webhooks.openai()` | Issued by the provider |
|
|
32
|
+
| [PagerDuty](/webhooks/providers/pagerduty) | `webhooks.pagerduty()` | Issued by the provider |
|
|
33
|
+
| [Plain](/webhooks/providers/plain) | `webhooks.plain()` | Issued by the provider |
|
|
34
|
+
| [PlanetScale](/webhooks/providers/planetscale) | `webhooks.planetscale()` | Issued by the provider |
|
|
35
|
+
| [Recall.ai](/webhooks/providers/recall-ai) | `webhooks.recallai()` | Issued by the provider |
|
|
36
|
+
| [Replicate](/webhooks/providers/replicate) | `webhooks.replicate()` | Issued by the provider |
|
|
37
|
+
| [Resend](/webhooks/providers/resend) | `webhooks.resend()` | Issued by the provider |
|
|
38
|
+
| [Retell AI](/webhooks/providers/retell) | `webhooks.retell()` | Your API key with the webhook badge |
|
|
39
|
+
| [Sentry](/webhooks/providers/sentry) | `webhooks.sentry()` | Issued by the provider |
|
|
40
|
+
| [Shopify](/webhooks/providers/shopify) | `webhooks.shopify()` | Issued by the provider |
|
|
41
|
+
| [Slack](/webhooks/providers/slack) | `webhookSource()` (`@trigger.dev/slack`) | Issued by the provider |
|
|
42
|
+
| [Square](/webhooks/providers/square) | `webhooks.square()` | Issued by the provider |
|
|
43
|
+
| [Stripe](/webhooks/providers/stripe) | `webhooks.stripe()` | Issued by the provider |
|
|
44
|
+
| [Supabase](/webhooks/providers/supabase) | `webhooks.supabase()` | You generate it |
|
|
45
|
+
| [Tailscale](/webhooks/providers/tailscale) | `webhooks.tailscale()` | Issued by the provider |
|
|
46
|
+
| [Typeform](/webhooks/providers/typeform) | `webhooks.typeform()` | You generate it |
|
|
47
|
+
| [Vapi](/webhooks/providers/vapi) | `webhooks.vapi()` | You generate it |
|
|
48
|
+
| [Vercel](/webhooks/providers/vercel) | `webhooks.vercel()` | Issued by the provider |
|
|
49
|
+
| [WhatsApp](/webhooks/providers/whatsapp) | `webhooks.whatsapp()` | Issued by the provider |
|
|
50
|
+
| [WorkOS](/webhooks/providers/workos) | `webhooks.workos()` | Issued by the provider |
|
|
51
|
+
| [Zendesk](/webhooks/providers/zendesk) | `webhooks.zendesk()` | Issued by the provider |
|
|
52
|
+
|
|
53
|
+
For a provider that isn't listed, define a [custom provider](/webhooks/custom-providers). For providers that sign with Svix or Standard Webhooks, `webhooks.svix()` and `webhooks.standardWebhooks()` also work; see [Verification](/webhooks/verification#svix-and-standard-webhooks).
|