@trigger.dev/sdk 4.8.4 → 4.8.6
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 +29 -5
- package/dist/commonjs/v3/ai.js +160 -114
- 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 +35 -12
- 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/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 +29 -5
- package/dist/esm/v3/ai.js +162 -117
- 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 +34 -12
- 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/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 +38 -15
- 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 +21 -0
- 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,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "DocuSign webhooks"
|
|
3
|
+
sidebarTitle: "DocuSign"
|
|
4
|
+
description: "Receive and verify DocuSign webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-docusign-signature-1 and run a task for each DocuSign event, filtered on event.event."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.docusign()` verifies the HMAC-SHA256 signature DocuSign sends in `x-docusign-signature-1` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/docusign.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const docusign = webhooks.endpoint.define({
|
|
13
|
+
id: "docusign",
|
|
14
|
+
source: webhooks.docusign(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const docusignEvents = webhook({
|
|
18
|
+
id: "docusign-events",
|
|
19
|
+
endpoint: docusign,
|
|
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.docusign()` |
|
|
31
|
+
| Verification | HMAC-SHA256 in `x-docusign-signature-1` |
|
|
32
|
+
| Credential | Connect secret key issued by DocuSign |
|
|
33
|
+
| Event type | `event.event` |
|
|
34
|
+
| DocuSign docs | [DocuSign webhook docs](https://developers.docusign.com/platform/webhooks/connect/) |
|
|
35
|
+
|
|
36
|
+
## Set up DocuSign
|
|
37
|
+
|
|
38
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
39
|
+
2. In DocuSign eSignature Admin, open **Connect > Connect Keys** and choose **Add Secret Key**. Copy the key: DocuSign shows it in full only once. Choose **Set signing secret** on the Trigger.dev endpoint and paste it.
|
|
40
|
+
3. Add a Connect configuration with the webhook URL, select the events your subscribers need, and tick **Include HMAC Signature**. Without it, DocuSign doesn't sign deliveries and every one is rejected.
|
|
41
|
+
4. Send a test event from DocuSign, 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: "ElevenLabs webhooks"
|
|
3
|
+
sidebarTitle: "ElevenLabs"
|
|
4
|
+
description: "Receive and verify ElevenLabs webhooks with Trigger.dev. Check the HMAC-SHA256 signature in elevenlabs-signature and run a task for each ElevenLabs event, filtered on event.type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.elevenlabs()` verifies the HMAC-SHA256 signature ElevenLabs sends in `elevenlabs-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/elevenlabs.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const elevenlabs = webhooks.endpoint.define({
|
|
13
|
+
id: "elevenlabs",
|
|
14
|
+
source: webhooks.elevenlabs(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const elevenlabsEvents = webhook({
|
|
18
|
+
id: "elevenlabs-events",
|
|
19
|
+
endpoint: elevenlabs,
|
|
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`.
|
|
27
|
+
|
|
28
|
+
| Setting | Value |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Source | `webhooks.elevenlabs()` |
|
|
31
|
+
| Verification | HMAC-SHA256 in `elevenlabs-signature` |
|
|
32
|
+
| Credential | Signing secret issued by ElevenLabs |
|
|
33
|
+
| Event type | `event.type` |
|
|
34
|
+
| ElevenLabs docs | [ElevenLabs webhook docs](https://elevenlabs.io/docs/eleven-agents/workflows/post-call-webhooks) |
|
|
35
|
+
|
|
36
|
+
## Set up ElevenLabs
|
|
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 ElevenLabs and select the events your subscribers need. See ElevenLabs's [webhook docs](https://elevenlabs.io/docs/eleven-agents/workflows/post-call-webhooks) for where its webhook settings are.
|
|
40
|
+
3. Copy the signing secret ElevenLabs shows for the webhook, then choose **Set signing secret** on the Trigger.dev endpoint.
|
|
41
|
+
4. Send a test event from ElevenLabs, 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,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Firecrawl webhooks"
|
|
3
|
+
sidebarTitle: "Firecrawl"
|
|
4
|
+
description: "Receive and verify Firecrawl webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-firecrawl-signature and run a task for each Firecrawl event, filtered on event.type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.firecrawl()` verifies the HMAC-SHA256 signature Firecrawl sends in `x-firecrawl-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/firecrawl.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const firecrawl = webhooks.endpoint.define({
|
|
13
|
+
id: "firecrawl",
|
|
14
|
+
source: webhooks.firecrawl(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const firecrawlEvents = webhook({
|
|
18
|
+
id: "firecrawl-events",
|
|
19
|
+
endpoint: firecrawl,
|
|
20
|
+
filter: "event.type == 'crawl.completed'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.firecrawl()` |
|
|
30
|
+
| Verification | HMAC-SHA256 in `x-firecrawl-signature` |
|
|
31
|
+
| Credential | Signing secret issued by Firecrawl |
|
|
32
|
+
| Event type | `event.type` |
|
|
33
|
+
| Firecrawl docs | [Firecrawl webhook docs](https://docs.firecrawl.dev/webhooks/overview) |
|
|
34
|
+
|
|
35
|
+
## Set up Firecrawl
|
|
36
|
+
|
|
37
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
38
|
+
2. Copy the webhook secret from the **Advanced** tab of your Firecrawl account settings. It is one secret for the whole account.
|
|
39
|
+
3. Choose **Set signing secret** on the Trigger.dev endpoint and paste it.
|
|
40
|
+
4. Firecrawl has no webhook settings page. Pass a `webhook` object with the URL and events on each crawl, batch scrape, extract or agent request instead:
|
|
41
|
+
|
|
42
|
+
```ts Your crawl code
|
|
43
|
+
await firecrawl.crawl("https://example.com", {
|
|
44
|
+
webhook: {
|
|
45
|
+
url: "<webhook URL>",
|
|
46
|
+
events: ["started", "page", "completed"],
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
5. Start a crawl with the `webhook` object, 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.
|
|
51
|
+
|
|
52
|
+
## Example task
|
|
53
|
+
|
|
54
|
+
The [Firecrawl URL crawl example](/guides/examples/firecrawl-url-crawl) crawls a site from a task. Add the `webhook` object above to receive each page as a delivery.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "GitHub webhooks"
|
|
3
|
+
sidebarTitle: "GitHub"
|
|
4
|
+
description: "Receive and verify GitHub webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-hub-signature-256 and run a task for each GitHub event, filtered on header.x-github-event."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.github()` verifies the HMAC-SHA256 signature GitHub sends in `x-hub-signature-256` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/github.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const github = webhooks.endpoint.define({
|
|
13
|
+
id: "github",
|
|
14
|
+
source: webhooks.github(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const githubEvents = webhook({
|
|
18
|
+
id: "github-events",
|
|
19
|
+
endpoint: github,
|
|
20
|
+
filter: "header.x-github-event == 'issues'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.github()` |
|
|
30
|
+
| Verification | HMAC-SHA256 in `x-hub-signature-256` |
|
|
31
|
+
| Credential | Secret you generate on Trigger.dev |
|
|
32
|
+
| Event type | `header.x-github-event` |
|
|
33
|
+
| GitHub docs | [GitHub webhook docs](https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries) |
|
|
34
|
+
|
|
35
|
+
## Set up GitHub
|
|
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. GitHub accepts a secret you choose.
|
|
39
|
+
3. Create the webhook. For a repository webhook with the `gh` CLI:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
gh api repos/OWNER/REPO/hooks -f name=web -f "config[url]=<webhook URL>" -f "config[content_type]=json" -f "config[secret]=<secret>" -f "events[]=issues" -F active=true
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Use `orgs/ORG/hooks` for an organization webhook. For a GitHub App, set the webhook URL and secret in the app's settings. Set the content type to `json`.
|
|
46
|
+
4. Trigger an event in the repository, 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: "GitLab webhooks"
|
|
3
|
+
sidebarTitle: "GitLab"
|
|
4
|
+
description: "Receive and verify GitLab webhooks with Trigger.dev. Check the secret token in x-gitlab-token and run a task for each GitLab event."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.gitlab()` checks the secret token GitLab sends in `x-gitlab-token` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/gitlab.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const gitlab = webhooks.endpoint.define({
|
|
13
|
+
id: "gitlab",
|
|
14
|
+
source: webhooks.gitlab(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const gitlabEvents = webhook({
|
|
18
|
+
id: "gitlab-events",
|
|
19
|
+
endpoint: gitlab,
|
|
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 `header.x-gitlab-event`.
|
|
27
|
+
|
|
28
|
+
| Setting | Value |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Source | `webhooks.gitlab()` |
|
|
31
|
+
| Verification | Shared secret in `x-gitlab-token` |
|
|
32
|
+
| Credential | Secret you generate on Trigger.dev |
|
|
33
|
+
| Event type | `header.x-gitlab-event` |
|
|
34
|
+
| GitLab docs | [GitLab webhook docs](https://docs.gitlab.com/user/project/integrations/webhooks/) |
|
|
35
|
+
|
|
36
|
+
## Set up GitLab
|
|
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 GitLab project or group, go to **Settings > Webhooks** and add a webhook with the webhook URL. Paste the secret into **Secret token** and select the triggers your subscribers need. GitLab sends the event name in the `x-gitlab-event` header.
|
|
41
|
+
4. Send a test event from GitLab, 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,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Granola webhooks"
|
|
3
|
+
sidebarTitle: "Granola"
|
|
4
|
+
description: "Receive and verify Granola webhooks with Trigger.dev. Check the Standard Webhooks signature and run a task for each Granola event, filtered on event.event_type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.granola()` verifies the Standard Webhooks signature Granola sends in the `webhook-*` headers on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/granola.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const granola = webhooks.endpoint.define({
|
|
13
|
+
id: "granola",
|
|
14
|
+
source: webhooks.granola(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const granolaEvents = webhook({
|
|
18
|
+
id: "granola-events",
|
|
19
|
+
endpoint: granola,
|
|
20
|
+
filter: "event.event_type == 'note.generated'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.granola()` |
|
|
30
|
+
| Verification | Standard Webhooks (`webhook-id`, `webhook-timestamp`, `webhook-signature`) |
|
|
31
|
+
| Credential | Signing secret issued by Granola |
|
|
32
|
+
| Event type | `event.event_type` |
|
|
33
|
+
| Granola docs | [Granola webhook docs](https://docs.granola.ai/webhooks) |
|
|
34
|
+
|
|
35
|
+
## Set up Granola
|
|
36
|
+
|
|
37
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
38
|
+
2. Create the endpoint in Granola under **Settings > Connectors > Webhooks**, or under a folder's **Integrations > Webhooks** to limit it to that folder. Granola webhooks need a Business or Enterprise plan.
|
|
39
|
+
3. Granola shows the signing secret (it starts with `whsec_`) once, when the endpoint is created. Choose **Set signing secret** on the Trigger.dev endpoint and paste it.
|
|
40
|
+
4. Send a test event from Granola, 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.
|
|
41
|
+
|
|
42
|
+
## Fetching the note
|
|
43
|
+
|
|
44
|
+
Deliveries carry the note id but not its content. Fetch the note with Granola's API inside `onEvent`.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Hookdeck webhooks"
|
|
3
|
+
sidebarTitle: "Hookdeck"
|
|
4
|
+
description: "Receive webhooks that Hookdeck forwards from any provider. Check the HMAC-SHA256 signature in x-hookdeck-signature and run a Trigger.dev task for each event."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.hookdeck()` verifies requests that a Hookdeck connection forwards, so you can put Hookdeck in front of any provider.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/hookdeck.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const hookdeck = webhooks.endpoint.define({
|
|
13
|
+
id: "hookdeck",
|
|
14
|
+
source: webhooks.hookdeck(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const hookdeckEvents = webhook({
|
|
18
|
+
id: "hookdeck-events",
|
|
19
|
+
endpoint: hookdeck,
|
|
20
|
+
onEvent: async ({ event }) => {
|
|
21
|
+
console.log(event);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Setting | Value |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| Source | `webhooks.hookdeck()` |
|
|
29
|
+
| Verification | HMAC-SHA256 in `x-hookdeck-signature` |
|
|
30
|
+
| Credential | Signing secret issued by Hookdeck |
|
|
31
|
+
| Event type | The original provider's field, for example `event.type` for Stripe |
|
|
32
|
+
| Hookdeck docs | [Hookdeck webhook docs](https://hookdeck.com/docs/authentication) |
|
|
33
|
+
|
|
34
|
+
## Set up Hookdeck
|
|
35
|
+
|
|
36
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
37
|
+
2. 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.
|
|
38
|
+
3. Copy the project's signing secret from [**Settings > Secrets**](https://dashboard.hookdeck.com/settings/project/secrets), then choose **Set signing secret** on the Trigger.dev endpoint. It is one secret for the whole project.
|
|
39
|
+
4. Send a test event from Hookdeck, 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
|
+
## Typing the event
|
|
42
|
+
|
|
43
|
+
Hookdeck forwards the original provider's body unchanged, so pass that provider's event type:
|
|
44
|
+
|
|
45
|
+
```ts /trigger/stripe-via-hookdeck.ts
|
|
46
|
+
import type Stripe from "stripe";
|
|
47
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
48
|
+
|
|
49
|
+
export const stripeViaHookdeck = webhooks.endpoint.define({
|
|
50
|
+
id: "stripe-via-hookdeck",
|
|
51
|
+
source: webhooks.hookdeck<Stripe.Event>(),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export const paymentSucceeded = webhook({
|
|
55
|
+
id: "payment-succeeded",
|
|
56
|
+
endpoint: stripeViaHookdeck,
|
|
57
|
+
filter: "event.type == 'payment_intent.succeeded'",
|
|
58
|
+
onEvent: async ({ event }) => {
|
|
59
|
+
console.log(event.id);
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Rotation, deduplication and header prefix
|
|
65
|
+
|
|
66
|
+
- **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.
|
|
67
|
+
- **Deduplication:** retries dedupe on `X-Hookdeck-Eventid`, which is the same on every attempt of a Hookdeck event.
|
|
68
|
+
- **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 the `X-Hookdeck-` name.
|
|
69
|
+
|
|
70
|
+
## Trigger a task through the API instead
|
|
71
|
+
|
|
72
|
+
You can also point a Hookdeck destination at the [trigger task API](/management/tasks/trigger) without a hosted endpoint. Hookdeck authenticates with your API key instead of a signature, and a transformation wraps the body in the `payload` field the API expects.
|
|
73
|
+
|
|
74
|
+
1. Create a destination with the URL `https://api.trigger.dev/api/v1/tasks/<task-id>/trigger`, method `POST`, and **Bearer token** authentication using a [**Trigger only**](/apikeys) environment API key.
|
|
75
|
+
2. Add a [transformation](https://hookdeck.com/docs/transformations):
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
addHandler("transform", (request, context) => {
|
|
79
|
+
request.body = { payload: request.body };
|
|
80
|
+
request.headers["content-type"] = "application/json";
|
|
81
|
+
return request;
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
3. 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.
|
|
86
|
+
|
|
87
|
+
```ts /trigger/webhook-handler.ts
|
|
88
|
+
import { task } from "@trigger.dev/sdk";
|
|
89
|
+
|
|
90
|
+
export const webhookHandler = task({
|
|
91
|
+
id: "webhook-handler",
|
|
92
|
+
run: async (payload: unknown) => {
|
|
93
|
+
console.log("Received webhook:", payload);
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
This path doesn't deduplicate Hookdeck retries, so each forwarded request starts a run, and the delivery isn't recorded on a Trigger.dev endpoint.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Infisical webhooks"
|
|
3
|
+
sidebarTitle: "Infisical"
|
|
4
|
+
description: "Receive and verify Infisical webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-infisical-signature and run a task for each Infisical event, filtered on event.event."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.infisical()` verifies the HMAC-SHA256 signature Infisical sends in `x-infisical-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/infisical.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const infisical = webhooks.endpoint.define({
|
|
13
|
+
id: "infisical",
|
|
14
|
+
source: webhooks.infisical(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const infisicalEvents = webhook({
|
|
18
|
+
id: "infisical-events",
|
|
19
|
+
endpoint: infisical,
|
|
20
|
+
filter: "event.event == 'secrets.modified'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.infisical()` |
|
|
30
|
+
| Verification | HMAC-SHA256 in `x-infisical-signature` |
|
|
31
|
+
| Credential | Secret you generate on Trigger.dev |
|
|
32
|
+
| Event type | `event.event` |
|
|
33
|
+
| Infisical docs | [Infisical webhook docs](https://infisical.com/docs/documentation/platform/webhooks) |
|
|
34
|
+
|
|
35
|
+
## Set up Infisical
|
|
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.
|
|
39
|
+
3. In Infisical, go to **Project Settings > Webhooks** and create a **General** webhook with the webhook URL. Optionally limit it to an environment and secret path.
|
|
40
|
+
4. Paste the secret into the webhook's secret key field. The secret is required: Infisical only signs webhooks that have one, and the endpoint rejects unsigned deliveries.
|
|
41
|
+
5. Send a test event from Infisical, 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: "Jira webhooks"
|
|
3
|
+
sidebarTitle: "Jira"
|
|
4
|
+
description: "Receive and verify Jira webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-hub-signature and run a task for each Jira event, filtered on event.webhookEvent."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.jira()` verifies the HMAC-SHA256 signature Jira sends in `x-hub-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/jira.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const jira = webhooks.endpoint.define({
|
|
13
|
+
id: "jira",
|
|
14
|
+
source: webhooks.jira(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const jiraEvents = webhook({
|
|
18
|
+
id: "jira-events",
|
|
19
|
+
endpoint: jira,
|
|
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.webhookEvent`.
|
|
27
|
+
|
|
28
|
+
| Setting | Value |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Source | `webhooks.jira()` |
|
|
31
|
+
| Verification | HMAC-SHA256 in `x-hub-signature` |
|
|
32
|
+
| Credential | Secret you generate on Trigger.dev |
|
|
33
|
+
| Event type | `event.webhookEvent` |
|
|
34
|
+
| Jira docs | [Jira webhook docs](https://developer.atlassian.com/cloud/jira/platform/webhooks/) |
|
|
35
|
+
|
|
36
|
+
## Set up Jira
|
|
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. As a Jira admin, open **System > WebHooks** and choose **Create a WebHook**. Enter the webhook URL, select the events your subscribers need, and paste the secret into **Secret**. Only webhooks an admin registers here are signed; webhooks registered by Connect or OAuth apps aren't, so the endpoint rejects them.
|
|
41
|
+
4. Send a test event from Jira, 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: "Langfuse webhooks"
|
|
3
|
+
sidebarTitle: "Langfuse"
|
|
4
|
+
description: "Receive and verify Langfuse webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-langfuse-signature and run a task for each Langfuse event, filtered on event.type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.langfuse()` verifies the HMAC-SHA256 signature Langfuse sends in `x-langfuse-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/langfuse.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const langfuse = webhooks.endpoint.define({
|
|
13
|
+
id: "langfuse",
|
|
14
|
+
source: webhooks.langfuse(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const langfuseEvents = webhook({
|
|
18
|
+
id: "langfuse-events",
|
|
19
|
+
endpoint: langfuse,
|
|
20
|
+
filter: "event.type == 'prompt-version' && event.action == 'created'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.langfuse()` |
|
|
30
|
+
| Verification | HMAC-SHA256 in `x-langfuse-signature` |
|
|
31
|
+
| Credential | Signing secret issued by Langfuse |
|
|
32
|
+
| Event type | `event.type` |
|
|
33
|
+
| Langfuse docs | [Langfuse webhook docs](https://langfuse.com/docs/prompt-management/features/webhooks-slack-integrations) |
|
|
34
|
+
|
|
35
|
+
## Set up Langfuse
|
|
36
|
+
|
|
37
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
38
|
+
2. In the Langfuse project, go to **Prompts > Automations > Create Automation**. Choose the prompt version event and the actions (created, updated, deleted) your subscribers need, and set the request URL to the webhook URL.
|
|
39
|
+
3. Copy the signing secret Langfuse shows (it starts with `lf-whsec_`), then choose **Set signing secret** on the Trigger.dev endpoint.
|
|
40
|
+
4. Send a test event from Langfuse, 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: "Linear webhooks"
|
|
3
|
+
sidebarTitle: "Linear"
|
|
4
|
+
description: "Receive and verify Linear webhooks with Trigger.dev. Check the HMAC-SHA256 signature in linear-signature and run a task for each Linear event, filtered on event.type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.linear()` verifies the HMAC-SHA256 signature Linear sends in `linear-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/linear.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const linear = webhooks.endpoint.define({
|
|
13
|
+
id: "linear",
|
|
14
|
+
source: webhooks.linear(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const linearEvents = webhook({
|
|
18
|
+
id: "linear-events",
|
|
19
|
+
endpoint: linear,
|
|
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`.
|
|
27
|
+
|
|
28
|
+
| Setting | Value |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Source | `webhooks.linear()` |
|
|
31
|
+
| Verification | HMAC-SHA256 in `linear-signature` |
|
|
32
|
+
| Credential | Signing secret issued by Linear |
|
|
33
|
+
| Event type | `event.type` |
|
|
34
|
+
| Linear docs | [Linear webhook docs](https://linear.app/developers/webhooks) |
|
|
35
|
+
|
|
36
|
+
## Set up Linear
|
|
37
|
+
|
|
38
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
39
|
+
2. In Linear, open **Settings > API** and choose **New webhook**. Enter the webhook URL and select the resource types your subscribers need.
|
|
40
|
+
3. Linear generates the signing secret and shows it on the webhook's page. Copy it, then choose **Set signing secret** on the Trigger.dev endpoint.
|
|
41
|
+
4. Send a test event from Linear, 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.
|
|
42
|
+
|
|
43
|
+
## Build a Linear agent
|
|
44
|
+
|
|
45
|
+
To work issues inside Linear's agent session UI, use the `linear()` connector from `@trigger.dev/linear`. See [Linear agents](/webhooks/linear).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Loops webhooks"
|
|
3
|
+
sidebarTitle: "Loops"
|
|
4
|
+
description: "Receive and verify Loops webhooks with Trigger.dev. Check the Standard Webhooks signature and run a task for each Loops event, filtered on event.eventName."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.loops()` verifies the Standard Webhooks signature Loops sends in the `webhook-*` headers on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/loops.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const loops = webhooks.endpoint.define({
|
|
13
|
+
id: "loops",
|
|
14
|
+
source: webhooks.loops(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const loopsEvents = webhook({
|
|
18
|
+
id: "loops-events",
|
|
19
|
+
endpoint: loops,
|
|
20
|
+
filter: "event.eventName == 'email.delivered'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.loops()` |
|
|
30
|
+
| Verification | Standard Webhooks (`webhook-id`, `webhook-timestamp`, `webhook-signature`) |
|
|
31
|
+
| Credential | Signing secret issued by Loops |
|
|
32
|
+
| Event type | `event.eventName` |
|
|
33
|
+
| Loops docs | [Loops webhook docs](https://loops.so/docs/webhooks) |
|
|
34
|
+
|
|
35
|
+
## Set up Loops
|
|
36
|
+
|
|
37
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
38
|
+
2. In Loops, go to **Settings > Webhooks**, add the webhook URL as the endpoint, and select the events your subscribers need.
|
|
39
|
+
3. Copy the endpoint's signing secret (it starts with `whsec_`), then choose **Set signing secret** on the Trigger.dev endpoint.
|
|
40
|
+
4. Send a `testing.testEvent` from the Loops settings page, 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,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Metronome webhooks"
|
|
3
|
+
sidebarTitle: "Metronome"
|
|
4
|
+
description: "Receive and verify Metronome webhooks with Trigger.dev. Check the HMAC-SHA256 signature in metronome-webhook-signature and run a task for each Metronome event, filtered on event.type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.metronome()` verifies the HMAC-SHA256 signature Metronome sends in `metronome-webhook-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/metronome.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const metronome = webhooks.endpoint.define({
|
|
13
|
+
id: "metronome",
|
|
14
|
+
source: webhooks.metronome(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const metronomeEvents = webhook({
|
|
18
|
+
id: "metronome-events",
|
|
19
|
+
endpoint: metronome,
|
|
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`.
|
|
27
|
+
|
|
28
|
+
| Setting | Value |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Source | `webhooks.metronome()` |
|
|
31
|
+
| Verification | HMAC-SHA256 in `metronome-webhook-signature` |
|
|
32
|
+
| Credential | Signing secret issued by Metronome |
|
|
33
|
+
| Event type | `event.type` |
|
|
34
|
+
| Metronome docs | [Metronome webhook docs](https://docs.metronome.com/guides/platform-configuration/setup-webhooks) |
|
|
35
|
+
|
|
36
|
+
## Set up Metronome
|
|
37
|
+
|
|
38
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
39
|
+
2. In the Metronome app, go to **Developer > Notifications > Webhooks > Add** and enter the webhook URL.
|
|
40
|
+
3. Copy the webhook's secret key, then choose **Set signing secret** on the Trigger.dev endpoint.
|
|
41
|
+
4. Create the notifications your subscribers need, such as a low credit balance alert, under **Developer > Notifications > Create Notification**.
|
|
42
|
+
5. Send a test event from Metronome, 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: "Mux webhooks"
|
|
3
|
+
sidebarTitle: "Mux"
|
|
4
|
+
description: "Receive and verify Mux webhooks with Trigger.dev. Check the HMAC-SHA256 signature in mux-signature and run a task for each Mux event, filtered on event.type."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`webhooks.mux()` verifies the HMAC-SHA256 signature Mux sends in `mux-signature` on every request.**
|
|
8
|
+
|
|
9
|
+
```ts /trigger/mux.ts
|
|
10
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
|
|
12
|
+
export const mux = webhooks.endpoint.define({
|
|
13
|
+
id: "mux",
|
|
14
|
+
source: webhooks.mux(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const muxEvents = webhook({
|
|
18
|
+
id: "mux-events",
|
|
19
|
+
endpoint: mux,
|
|
20
|
+
filter: "event.type == 'video.asset.ready'",
|
|
21
|
+
onEvent: async ({ event }) => {
|
|
22
|
+
console.log(event);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Setting | Value |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Source | `webhooks.mux()` |
|
|
30
|
+
| Verification | HMAC-SHA256 in `mux-signature` |
|
|
31
|
+
| Credential | Signing secret issued by Mux |
|
|
32
|
+
| Event type | `event.type` |
|
|
33
|
+
| Mux docs | [Mux webhook docs](https://www.mux.com/docs/core/verify-webhook-signatures) |
|
|
34
|
+
|
|
35
|
+
## Set up Mux
|
|
36
|
+
|
|
37
|
+
1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
|
|
38
|
+
2. In the [Mux webhook settings](https://dashboard.mux.com/settings/webhooks), select the environment your app uses and add the webhook URL. Mux sends every event in that environment.
|
|
39
|
+
3. Copy that webhook's signing secret, then choose **Set signing secret** on the Trigger.dev endpoint.
|
|
40
|
+
4. Send a test event from Mux, 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.
|