@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.
Files changed (193) hide show
  1. package/dist/commonjs/v3/ai.d.ts +34 -8
  2. package/dist/commonjs/v3/ai.js +304 -168
  3. package/dist/commonjs/v3/ai.js.map +1 -1
  4. package/dist/commonjs/v3/auth.d.ts +4 -4
  5. package/dist/commonjs/v3/auth.js +21 -75
  6. package/dist/commonjs/v3/auth.js.map +1 -1
  7. package/dist/commonjs/v3/chat-client.d.ts +1 -1
  8. package/dist/commonjs/v3/chat.d.ts +1 -1
  9. package/dist/commonjs/v3/prompt.js +6 -8
  10. package/dist/commonjs/v3/prompt.js.map +1 -1
  11. package/dist/commonjs/v3/runs.d.ts +5 -1
  12. package/dist/commonjs/v3/runs.js.map +1 -1
  13. package/dist/commonjs/v3/sessions.js +10 -7
  14. package/dist/commonjs/v3/sessions.js.map +1 -1
  15. package/dist/commonjs/v3/shared.d.ts +2 -2
  16. package/dist/commonjs/v3/shared.js +16 -15
  17. package/dist/commonjs/v3/shared.js.map +1 -1
  18. package/dist/commonjs/v3/steeringContext.d.ts +35 -10
  19. package/dist/commonjs/v3/steeringContext.js +86 -14
  20. package/dist/commonjs/v3/steeringContext.js.map +1 -1
  21. package/dist/commonjs/v3/streams.js +10 -8
  22. package/dist/commonjs/v3/streams.js.map +1 -1
  23. package/dist/commonjs/v3/tasks.d.ts +2 -2
  24. package/dist/commonjs/v3/tasks.js.map +1 -1
  25. package/dist/commonjs/v3/test/mock-chat-agent.js +24 -13
  26. package/dist/commonjs/v3/test/mock-chat-agent.js.map +1 -1
  27. package/dist/commonjs/v3/toolOutputJson.d.ts +17 -0
  28. package/dist/commonjs/v3/toolOutputJson.js +241 -0
  29. package/dist/commonjs/v3/toolOutputJson.js.map +1 -0
  30. package/dist/commonjs/v3/webhooks.d.ts +8 -2
  31. package/dist/commonjs/v3/webhooks.js +20 -11
  32. package/dist/commonjs/v3/webhooks.js.map +1 -1
  33. package/dist/commonjs/version.js +1 -1
  34. package/dist/esm/v3/ai.d.ts +34 -8
  35. package/dist/esm/v3/ai.js +306 -171
  36. package/dist/esm/v3/ai.js.map +1 -1
  37. package/dist/esm/v3/auth.d.ts +4 -4
  38. package/dist/esm/v3/auth.js +22 -76
  39. package/dist/esm/v3/auth.js.map +1 -1
  40. package/dist/esm/v3/chat-client.d.ts +1 -1
  41. package/dist/esm/v3/chat.d.ts +1 -1
  42. package/dist/esm/v3/prompt.js +6 -8
  43. package/dist/esm/v3/prompt.js.map +1 -1
  44. package/dist/esm/v3/runs.d.ts +5 -1
  45. package/dist/esm/v3/runs.js.map +1 -1
  46. package/dist/esm/v3/sessions.js +10 -7
  47. package/dist/esm/v3/sessions.js.map +1 -1
  48. package/dist/esm/v3/shared.d.ts +2 -2
  49. package/dist/esm/v3/shared.js +16 -15
  50. package/dist/esm/v3/shared.js.map +1 -1
  51. package/dist/esm/v3/steeringContext.d.ts +35 -10
  52. package/dist/esm/v3/steeringContext.js +85 -14
  53. package/dist/esm/v3/steeringContext.js.map +1 -1
  54. package/dist/esm/v3/streams.js +10 -8
  55. package/dist/esm/v3/streams.js.map +1 -1
  56. package/dist/esm/v3/tasks.d.ts +2 -2
  57. package/dist/esm/v3/tasks.js.map +1 -1
  58. package/dist/esm/v3/test/mock-chat-agent.js +25 -14
  59. package/dist/esm/v3/test/mock-chat-agent.js.map +1 -1
  60. package/dist/esm/v3/toolOutputJson.d.ts +17 -0
  61. package/dist/esm/v3/toolOutputJson.js +238 -0
  62. package/dist/esm/v3/toolOutputJson.js.map +1 -0
  63. package/dist/esm/v3/webhooks.d.ts +8 -2
  64. package/dist/esm/v3/webhooks.js +20 -11
  65. package/dist/esm/v3/webhooks.js.map +1 -1
  66. package/dist/esm/version.js +1 -1
  67. package/docs/ai/observability.mdx +25 -19
  68. package/docs/ai/prompts.mdx +25 -19
  69. package/docs/ai-chat/actions.mdx +1 -1
  70. package/docs/ai-chat/anatomy.mdx +1 -1
  71. package/docs/ai-chat/backend.mdx +24 -24
  72. package/docs/ai-chat/background-injection.mdx +5 -5
  73. package/docs/ai-chat/chat-local.mdx +2 -2
  74. package/docs/ai-chat/compaction.mdx +47 -18
  75. package/docs/ai-chat/custom-agents.mdx +4 -4
  76. package/docs/ai-chat/error-handling.mdx +4 -4
  77. package/docs/ai-chat/fast-starts.mdx +8 -7
  78. package/docs/ai-chat/frontend.mdx +6 -2
  79. package/docs/ai-chat/lifecycle-hooks.mdx +11 -11
  80. package/docs/ai-chat/migrating-from-a-route-handler.mdx +4 -4
  81. package/docs/ai-chat/migrating-from-hydrate-messages.mdx +1 -1
  82. package/docs/ai-chat/overview.mdx +1 -1
  83. package/docs/ai-chat/patterns/branching-conversations.mdx +1 -1
  84. package/docs/ai-chat/patterns/database-persistence.mdx +2 -2
  85. package/docs/ai-chat/patterns/human-in-the-loop.mdx +1 -1
  86. package/docs/ai-chat/patterns/native-compaction.mdx +29 -9
  87. package/docs/ai-chat/patterns/persistence-and-replay.mdx +1 -1
  88. package/docs/ai-chat/patterns/redacting-telemetry.mdx +2 -2
  89. package/docs/ai-chat/patterns/skills.mdx +2 -2
  90. package/docs/ai-chat/patterns/sub-agents.mdx +1 -1
  91. package/docs/ai-chat/patterns/tool-result-auditing.mdx +1 -1
  92. package/docs/ai-chat/patterns/trusted-edge-signals.mdx +2 -2
  93. package/docs/ai-chat/patterns/version-upgrades.mdx +2 -2
  94. package/docs/ai-chat/pending-messages.mdx +5 -5
  95. package/docs/ai-chat/prompt-caching.mdx +7 -7
  96. package/docs/ai-chat/quick-start.mdx +2 -2
  97. package/docs/ai-chat/testing.mdx +9 -9
  98. package/docs/ai-chat/tools.mdx +9 -5
  99. package/docs/ai-chat/transcript-storage.mdx +2 -2
  100. package/docs/ai-chat/types.mdx +10 -3
  101. package/docs/apikeys.mdx +2 -1
  102. package/docs/cli-login-commands.mdx +12 -0
  103. package/docs/concurrency.mdx +40 -0
  104. package/docs/database-connections.mdx +1 -1
  105. package/docs/deploy-environment-variables.mdx +84 -2
  106. package/docs/deployment/trusted-publishing.mdx +4 -0
  107. package/docs/errors-retrying.mdx +25 -18
  108. package/docs/github-actions.mdx +1 -1
  109. package/docs/github-integration.mdx +32 -1
  110. package/docs/how-it-works.mdx +4 -2
  111. package/docs/introduction.mdx +1 -1
  112. package/docs/mcp-introduction.mdx +7 -1
  113. package/docs/mcp-remote.mdx +90 -0
  114. package/docs/oidc/azure.mdx +81 -0
  115. package/docs/oidc/databricks.mdx +99 -0
  116. package/docs/oidc/doppler.mdx +60 -0
  117. package/docs/oidc/gcp.mdx +109 -0
  118. package/docs/oidc/hugging-face.mdx +90 -0
  119. package/docs/oidc/openrouter.mdx +91 -0
  120. package/docs/oidc/snowflake.mdx +91 -0
  121. package/docs/oidc/vault.mdx +71 -0
  122. package/docs/oidc.mdx +2 -0
  123. package/docs/runs/metadata.mdx +1 -1
  124. package/docs/self-hosting/docker.mdx +2 -0
  125. package/docs/self-hosting/env/webapp.mdx +4 -1
  126. package/docs/self-hosting/kubernetes.mdx +2 -0
  127. package/docs/tasks/schemaTask.mdx +26 -13
  128. package/docs/tasks/streams.mdx +2 -2
  129. package/docs/troubleshooting.mdx +7 -0
  130. package/docs/webhooks/channels.mdx +6 -6
  131. package/docs/webhooks/connect.mdx +9 -75
  132. package/docs/webhooks/custom-providers.mdx +87 -0
  133. package/docs/webhooks/deliveries.mdx +7 -7
  134. package/docs/webhooks/filters.mdx +2 -2
  135. package/docs/webhooks/how-it-works.mdx +58 -0
  136. package/docs/webhooks/human-in-the-loop.mdx +3 -3
  137. package/docs/webhooks/linear.mdx +5 -3
  138. package/docs/webhooks/overview.mdx +20 -71
  139. package/docs/webhooks/own-handler.mdx +62 -0
  140. package/docs/webhooks/pricing-and-limits.mdx +13 -0
  141. package/docs/webhooks/providers/attio.mdx +38 -0
  142. package/docs/webhooks/providers/autumn.mdx +40 -0
  143. package/docs/webhooks/providers/cal-com.mdx +41 -0
  144. package/docs/webhooks/providers/calendly.mdx +41 -0
  145. package/docs/webhooks/providers/clerk.mdx +40 -0
  146. package/docs/webhooks/providers/discord.mdx +45 -0
  147. package/docs/webhooks/providers/docusign.mdx +41 -0
  148. package/docs/webhooks/providers/elevenlabs.mdx +41 -0
  149. package/docs/webhooks/providers/firecrawl.mdx +54 -0
  150. package/docs/webhooks/providers/github.mdx +46 -0
  151. package/docs/webhooks/providers/gitlab.mdx +41 -0
  152. package/docs/webhooks/providers/granola.mdx +44 -0
  153. package/docs/webhooks/providers/hookdeck.mdx +98 -0
  154. package/docs/webhooks/providers/infisical.mdx +41 -0
  155. package/docs/webhooks/providers/jira.mdx +41 -0
  156. package/docs/webhooks/providers/langfuse.mdx +40 -0
  157. package/docs/webhooks/providers/linear.mdx +45 -0
  158. package/docs/webhooks/providers/loops.mdx +40 -0
  159. package/docs/webhooks/providers/metronome.mdx +42 -0
  160. package/docs/webhooks/providers/mux.mdx +40 -0
  161. package/docs/webhooks/providers/openai.mdx +40 -0
  162. package/docs/webhooks/providers/pagerduty.mdx +40 -0
  163. package/docs/webhooks/providers/plain.mdx +41 -0
  164. package/docs/webhooks/providers/planetscale.mdx +40 -0
  165. package/docs/webhooks/providers/recall-ai.mdx +54 -0
  166. package/docs/webhooks/providers/replicate.mdx +41 -0
  167. package/docs/webhooks/providers/resend.mdx +44 -0
  168. package/docs/webhooks/providers/retell.mdx +41 -0
  169. package/docs/webhooks/providers/sentry.mdx +41 -0
  170. package/docs/webhooks/providers/shopify.mdx +49 -0
  171. package/docs/webhooks/providers/slack.mdx +48 -0
  172. package/docs/webhooks/providers/square.mdx +40 -0
  173. package/docs/webhooks/providers/stripe.mdx +86 -0
  174. package/docs/webhooks/providers/supabase.mdx +41 -0
  175. package/docs/webhooks/providers/tailscale.mdx +43 -0
  176. package/docs/webhooks/providers/typeform.mdx +42 -0
  177. package/docs/webhooks/providers/vapi.mdx +47 -0
  178. package/docs/webhooks/providers/vercel.mdx +40 -0
  179. package/docs/webhooks/providers/whatsapp.mdx +45 -0
  180. package/docs/webhooks/providers/workos.mdx +41 -0
  181. package/docs/webhooks/providers/zendesk.mdx +41 -0
  182. package/docs/webhooks/providers.mdx +53 -0
  183. package/docs/webhooks/quick-start.mdx +131 -0
  184. package/docs/webhooks/session-routing.mdx +6 -6
  185. package/docs/webhooks/signing-secrets.mdx +80 -0
  186. package/docs/webhooks/slack.mdx +11 -2
  187. package/docs/webhooks/verification.mdx +139 -0
  188. package/docs/webhooks/waiters.mdx +2 -2
  189. package/docs/webhooks/webhook-tasks.mdx +46 -0
  190. package/package.json +4 -5
  191. package/docs/migrating-from-v3.mdx +0 -332
  192. package/docs/webhooks/public-beta.mdx +0 -70
  193. package/docs/webhooks/sources.mdx +0 -252
@@ -79,12 +79,94 @@ You can edit an environment variable's values. You cannot edit the key name, you
79
79
  </Step>
80
80
 
81
81
  <Step title="Press delete">
82
- This will immediately delete the variable. ![Environment variables
82
+ Confirm in the dialog to delete the variable's value from that environment. This can't be
83
+ undone. ![Environment variables
83
84
  page](/images/environment-variables-delete-popover.png)
84
85
  </Step>
85
86
 
86
87
  </Steps>
87
88
 
89
+ #### Deleting several values at once
90
+
91
+ Each row on the Environment Variables page is one value: a key in one environment or preview branch. You can select up to 100 values and delete them in one step.
92
+
93
+ <Steps>
94
+
95
+ <Step title="Tick the values to delete">
96
+ Tick the checkbox on each row, or tick the checkbox in the table header to select the values on
97
+ the current page. Shift-click selects a range. A bar at the bottom of the list shows how many
98
+ values are selected.
99
+ </Step>
100
+
101
+ <Step title="Press Delete in the bar">
102
+ The confirmation lists every selected value and counts them per environment.
103
+ </Step>
104
+
105
+ <Step title="Type the confirmation words and press Delete">
106
+ The selected values are deleted together. If any of them can't be deleted, none are.
107
+ </Step>
108
+
109
+ </Steps>
110
+
111
+ The selection applies to the current view of the list, so it clears when you change the filter, search, sort or page. A row has no checkbox when you don't have permission to delete its value. Deleting a preview branch's override makes that branch use the Preview value again.
112
+
113
+ ### Comparing two environments
114
+
115
+ The compare view lists the keys that differ between two environments, so you don't have to read both lists side by side. Press **Compare** on the Environment Variables page to open it with the current environment on the left. Each side can be your Dev environment, Staging, Prod, Preview or one preview branch: pick them in the column headers. The two sides are in the URL, so you can share a comparison.
116
+
117
+ The filters narrow the list:
118
+
119
+ | Filter | Lists the keys that |
120
+ | --- | --- |
121
+ | All | differ in any way (every key except the ones that are the same) |
122
+ | Different | are set on both sides with different values |
123
+ | Missing | are set on one side only (one filter for each side) |
124
+ | Empty | are empty on one side only |
125
+ | Same | have the same value on both sides |
126
+
127
+ Secrets are compared on the server: the view says whether two secrets are the same or different, and never shows either value. A secret is never compared with a plain value, because the plain value on the page would reveal the secret; such keys are listed under All and say they weren't compared. A side you don't have permission to read shows "Permission denied" and is never compared.
128
+
129
+ Comparing a preview branch with Preview lists the branch's own overrides. To compare only some keys, tick them on the Environment Variables page and press **Compare** in the bar. Up to 1,000 keys can be compared at once; above that, search to narrow them down or compare ticked keys.
130
+
131
+ #### Copying values across
132
+
133
+ You can copy values from one side of the comparison to the other, in either direction.
134
+
135
+ <Steps>
136
+
137
+ <Step title="Choose the values">
138
+ Hover a row and press **Copy to** with the target environment's name, or tick up to 100 rows and
139
+ press **Copy to** in the bar at the bottom of the list.
140
+ </Step>
141
+
142
+ <Step title="Confirm">
143
+ The dialog says which keys are added to the target and which existing values are replaced, and
144
+ which ticked keys are skipped (not set or not readable on the source side, already the same, or
145
+ empty when your organization doesn't allow empty values). Copying several values asks you to type
146
+ two words to confirm.
147
+ </Step>
148
+
149
+ </Steps>
150
+
151
+ The values are copied together: if any of them can't be copied, none are. A copied secret stays a secret, and a value copied onto a secret stays a secret. You need permission to read the source environment and to change the target. Copying replaces values in the target environment, so runs that start afterwards use the new values.
152
+
153
+ ### Values that need attention
154
+
155
+ The Needs attention page lists the keys in one environment that are probably wrong or worth a second look. Press **Needs attention** on the Environment Variables page to open it; the button shows how many keys need attention in the current environment, leaving out empty values. Pick the environment (your Dev environment, Staging, Prod or Preview) in the value column's header.
156
+
157
+ | Tab | Lists the keys that |
158
+ | --- | --- |
159
+ | All | need attention for any reason, grouped by the most pressing one |
160
+ | Missing here | are set in another of Dev, Staging and Prod but not in this environment |
161
+ | Empty | are set to an empty string, secrets included |
162
+ | Replace with OIDC | hold credentials that [OIDC](/oidc) could replace, in deployed environments when your organization has OIDC |
163
+ | Changed recently | were saved in the last 24 hours, newest first |
164
+ | Ignored | have a reason your team ignored |
165
+
166
+ A Missing here row offers **Copy from** to copy the value from an environment where it's set, through the same confirmation as [copying values across](#copying-values-across), or **Set** to enter a new one.
167
+
168
+ Ignore a reason when it's expected, such as a key that is only meant to exist in Prod. An ignore applies to one key, in one environment, for one reason, and is shared with everyone on the project, who see who ignored it and when. Ignored reasons move to the Ignored tab until someone presses **Stop ignoring**. An ignored empty value stops being ignored the next time the value is saved. Changed recently can't be ignored: a key leaves that tab a day after it was saved.
169
+
88
170
  ## Local development
89
171
 
90
172
  When running `npx trigger.dev dev`, the CLI automatically loads environment variables from these files in order (later files override any duplicate keys from earlier ones):
@@ -221,7 +303,7 @@ If your secrets live in [Infisical](https://infisical.com), sync them natively,
221
303
 
222
304
  Set it up in Infisical in two steps:
223
305
 
224
- 1. Add a **Trigger.dev App Connection** using a Trigger.dev Personal Access Token from your account settings. Self-hosted instances are supported.
306
+ 1. Add a **Trigger.dev App Connection** using a Trigger.dev Personal Access Token from your account settings. Self-hosted instances are supported. The token [expires](/management/authentication#pat-expiry) on the date you choose, so replace it in the App Connection before then to keep the sync running.
225
307
  2. Create a **Secret Sync**: choose the connection, pick the target organization, project and environment (Production, Staging, Development, or Preview), and set the secret path to sync.
226
308
 
227
309
  Follow the [Trigger.dev Secret Sync guide](https://infisical.com/docs/integrations/secret-syncs/trigger-dev) in the Infisical docs for the full walkthrough.
@@ -5,6 +5,10 @@ description: "Deploy from GitHub Actions without storing a Trigger.dev API key."
5
5
 
6
6
  Trusted publishing uses GitHub Actions OIDC tokens to authorize deployments. No Personal Access Token or environment API key is needed in GitHub secrets. Builds run entirely on Trigger.dev's build server.
7
7
 
8
+ ## Prerequisites
9
+
10
+ - Use the Trigger.dev CLI (`trigger.dev`) **4.8.4 or later**, including the CLI used in CI.
11
+
8
12
  ## Configure trust
9
13
 
10
14
  1. Select **Staging**, **Preview**, or **Production**, then open [**Trusted publishing**](https://cloud.trigger.dev/_/trusted-publishing) under **Security**.
@@ -216,7 +216,7 @@ export const openaiTask = task({
216
216
  run: async (payload: { prompt: string }) => {
217
217
  const chatCompletion = await openai.chat.completions.create({
218
218
  messages: [{ role: "user", content: payload.prompt }],
219
- model: "gpt-3.5-turbo",
219
+ model: "gpt-6-luna",
220
220
  });
221
221
 
222
222
  return chatCompletion.choices[0].message.content;
@@ -319,7 +319,7 @@ export const openaiTask = task({
319
319
  //if this fails, it will throw an error and stop retrying
320
320
  const chatCompletion = await openai.chat.completions.create({
321
321
  messages: [{ role: "user", content: payload.prompt }],
322
- model: "gpt-3.5-turbo",
322
+ model: "gpt-6-luna",
323
323
  });
324
324
 
325
325
  if (chatCompletion.choices[0]?.message.content === undefined) {
@@ -334,10 +334,15 @@ export const openaiTask = task({
334
334
 
335
335
  ### Using try/catch
336
336
 
337
- Sometimes you want to catch an error and don't want to retry the task. You can use try/catch as you normally would. In this example we fallback to using Replicate if OpenAI fails.
337
+ Sometimes you want to catch an error and don't want to retry the task. You can use try/catch as you normally would. In this example we fall back to using Anthropic if OpenAI fails.
338
338
 
339
339
  ```ts /trigger/myTasks.ts
340
340
  import { task } from "@trigger.dev/sdk";
341
+ import Anthropic from "@anthropic-ai/sdk";
342
+ import OpenAI from "openai";
343
+
344
+ const openai = new OpenAI();
345
+ const anthropic = new Anthropic();
341
346
 
342
347
  export const openaiTask = task({
343
348
  id: "openai-task",
@@ -346,7 +351,7 @@ export const openaiTask = task({
346
351
  //if this fails, it will throw an error and retry
347
352
  const chatCompletion = await openai.chat.completions.create({
348
353
  messages: [{ role: "user", content: payload.prompt }],
349
- model: "gpt-3.5-turbo",
354
+ model: "gpt-6-luna",
350
355
  });
351
356
 
352
357
  if (chatCompletion.choices[0]?.message.content === undefined) {
@@ -356,23 +361,25 @@ export const openaiTask = task({
356
361
 
357
362
  return chatCompletion.choices[0].message.content;
358
363
  } catch (error) {
359
- //use Replicate if OpenAI fails
360
- const prediction = await replicate.run(
361
- "meta/llama-2-70b-chat:02e509c789964a7ea8736978a43525956ef40397be9033abf9fd2badfe68c9e3",
362
- {
363
- input: {
364
- prompt: payload.prompt,
365
- max_new_tokens: 250,
366
- },
367
- }
368
- );
364
+ //use Anthropic if OpenAI fails
365
+ const message = await anthropic.messages.create({
366
+ model: "claude-haiku-5-5",
367
+ max_tokens: 16000,
368
+ messages: [{ role: "user", content: payload.prompt }],
369
+ });
370
+
371
+ //the response can include thinking blocks, so only read the text blocks
372
+ const text = message.content
373
+ .filter((block) => block.type === "text")
374
+ .map((block) => block.text)
375
+ .join("");
369
376
 
370
- if (prediction.output === undefined) {
371
- //retry if Replicate fails
372
- throw new Error("Replicate call failed");
377
+ if (!text) {
378
+ //retry if Anthropic fails
379
+ throw new Error("Anthropic call failed");
373
380
  }
374
381
 
375
- return prediction.output;
382
+ return text;
376
383
  }
377
384
  },
378
385
  });
@@ -3,7 +3,7 @@ title: "CI / GitHub Actions"
3
3
  description: "Deploy your tasks from CI using trusted deploys or an environment API key."
4
4
  ---
5
5
 
6
- For GitHub Actions without stored credentials, use [Trusted publishing](/deployment/trusted-publishing) with OIDC. The API-key instructions below also apply to other CI systems. Use an environment API key rather than a Personal Access Token so deployments are not tied to an individual team member's account or permissions.
6
+ For GitHub Actions without stored credentials, use [Trusted publishing](/deployment/trusted-publishing) with OIDC. The API-key instructions below also apply to other CI systems. Use an environment API key rather than a Personal Access Token so deployments are not tied to an individual team member's account or permissions. A Personal Access Token also [expires](/management/authentication#pat-expiry) on the date chosen when it was created, and a copied CLI login [expires after 7 days without use](/cli-login-commands#login-expiry).
7
7
 
8
8
  <Tip>
9
9
  Check out our new [GitHub integration](/github-integration) for automatic deployments, without adding any GitHub Actions workflows.
@@ -54,7 +54,7 @@ When you connect a repository, the default branch of your repository will be use
54
54
  When you configure a production or staging branch, every push to that branch will trigger a deployment.
55
55
  Our build server will install the project dependencies, build your project, and deploy it to the corresponding environment.
56
56
 
57
- If there are multiple consecutive pushes to a tracked branch, the later deployments will be queued until the previous deployment completes.
57
+ Builds for an environment run one at a time, in the order the pushes arrived, so a push made while another build is running waits in a queue. Each preview branch has its own queue. A deployment still queued 15 minutes after it was created times out.
58
58
 
59
59
  <Note>
60
60
  When you connect a repository, the default branch of your repository will be used as the production tracking branch by default.
@@ -72,6 +72,37 @@ The name of the preview branch matches the branch name of the pull request.
72
72
  Preview branch deployments require the preview environment to be enabled on your project. Learn more about [preview branches](/deployment/preview-branches).
73
73
  </Note>
74
74
 
75
+ ### Skip superseded builds
76
+
77
+ When you push a newer commit while an older one is still queued, the older build is skipped. Its deployment shows as **Superseded** and its GitHub check is marked skipped, so only the newest queued commit builds. A build that has already started always finishes. Each preview branch is handled on its own.
78
+
79
+ Turn this on or off for each environment with the **Skip superseded** switches in your project's Git settings. It's on by default for staging and preview, and off for production.
80
+
81
+ <Warning>
82
+ With [version skew protection](/deployment/atomic-deployment), runs from a skipped commit's app wait for a build that never happens, then expire. On Vercel this affects staging and preview. Turn Skip superseded off for an environment whose app serves traffic from every commit.
83
+ </Warning>
84
+
85
+ ## Ignored branches
86
+
87
+ Ignored branches stop pull requests from matching branches from getting a preview deployment, for example Dependabot updates.
88
+
89
+ Open **Integrations** in your project settings and add the patterns in the git settings panel, one per line. Use **Test a branch** to check which pattern, if any, matches a branch.
90
+
91
+ ```text
92
+ dependabot/**
93
+ skip-preview/**
94
+ ```
95
+
96
+ - Patterns match the whole branch name. `*` stays within one part of the name and `**` also crosses `/`, so `skip-preview/**` matches `skip-preview/login` and `skip-preview` itself.
97
+ - Negation (`!`), braces (`{a,b}`) and extglob groups like `@(a|b)` aren't supported. A pattern can use `**` at most twice and `*` at most twice more, and you can add up to 100 patterns of up to 256 characters each.
98
+ - Only previews are affected: pushes to your production and staging branches always deploy, and a preview deployed before you added a pattern is archived as usual.
99
+
100
+ When a preview is skipped, the pull request's Trigger.dev check is marked as skipped with the matching pattern. Re-run that check from GitHub to deploy the preview anyway.
101
+
102
+ <Warning>
103
+ If your project is connected to Vercel, ignore the same branches in both places. A Vercel preview of a branch that Trigger.dev ignores has no task deployment for its commit, so with [version skew protection](/vercel-integration#version-skew-protection) its runs wait for one and [expire after an hour](/deployment/atomic-deployment#waiting-and-expiry).
104
+ </Warning>
105
+
75
106
  ## Ignored paths
76
107
 
77
108
  Skip builds for pushes that only touch files your tasks do not depend on, such as docs or another app in a monorepo.
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  title: "How Trigger.dev works"
3
3
  sidebarTitle: "How it works"
4
- description: "Understand how Trigger.dev works and how it can help you."
4
+ description: "Understand how Trigger.dev runs durable AI agents and workflows."
5
5
  ---
6
6
 
7
7
  ## Introduction
8
8
 
9
- Trigger.dev allows you to integrate long-running async tasks into your application and run them in the background. This allows you to offload tasks that take a long time to complete, such as sending multi-day email campaigns, processing videos, or running long chains of AI tasks.
9
+ Trigger.dev is the open source platform for building and running durable AI agents and workflows in TypeScript. You write tasks and agents in your existing codebase, and they run on Trigger.dev with retries, queues, waits, full tracing, and elastic scaling. There's no execution timeout, so you can offload work that takes a long time to complete, such as AI agents with human-in-the-loop approvals, processing videos, or sending multi-day email campaigns.
10
+
11
+ To build durable chat agents, see [AI Agents](/ai-chat/overview).
10
12
 
11
13
  For example, the below task processes a video with `ffmpeg` and sends the results to an s3 bucket, then updates a database with the results and sends an email to the user.
12
14
 
@@ -44,7 +44,7 @@ export const supportAgent = chat.agent({
44
44
  id: "support-agent",
45
45
  run: async ({ messages, signal, streamText }) =>
46
46
  streamText({
47
- model: anthropic("claude-sonnet-4-5"),
47
+ model: anthropic("claude-sonnet-5-5"),
48
48
  messages,
49
49
  abortSignal: signal,
50
50
  }),
@@ -16,6 +16,10 @@ The Trigger.dev MCP (Model Context Protocol) Server enables AI assistants to int
16
16
  - Monitor run details and list runs with filtering options
17
17
  - Query your data with TRQL and run built-in dashboard metrics
18
18
 
19
+ <Note>
20
+ This page covers the CLI MCP server, which runs locally and can deploy and run your dev server. To connect over HTTP without installing anything, use the [remote MCP server](/mcp-remote).
21
+ </Note>
22
+
19
23
  ## Installation
20
24
 
21
25
  The quickest way to get set up is the interactive installer:
@@ -299,7 +303,9 @@ After adding the config, restart your client. You should see a server named **tr
299
303
 
300
304
  ## Authentication
301
305
 
302
- The `search_docs` tool works without authentication, and so do the local-only tools `list_profiles`, `dev_server_status` and `stop_dev_server`. All other tools require you to be logged in via the [Trigger.dev CLI](/cli-login-commands). The first time you use an authenticated tool, your MCP client will prompt you to log in.
306
+ The `search_docs` tool works without authentication, and so do the local-only tools `list_profiles`, `dev_server_status` and `stop_dev_server`. All other tools require you to be logged in via the [Trigger.dev CLI](/cli-login-commands). The first time you use an authenticated tool, your MCP client prompts you to log in.
307
+
308
+ A login stops working after 7 days without use. The next authenticated tool call starts the login flow again. If your client supports confirmation prompts, it asks first. Then the browser opens, and the call continues once you approve. See [CLI login expiry](/cli-login-commands#login-expiry).
303
309
 
304
310
  <Accordion title="CLI Options">
305
311
 
@@ -0,0 +1,90 @@
1
+ ---
2
+ title: "Remote MCP server"
3
+ sidebarTitle: "Remote server"
4
+ description: "Connect AI assistants to your Trigger.dev projects over HTTP with OAuth, with no local install."
5
+ ---
6
+
7
+ **The remote MCP server exposes Trigger.dev tools over HTTP at `https://mcp.trigger.dev/mcp`, so an assistant can read runs, trigger tasks, and manage resources without running the CLI.**
8
+
9
+ You sign in with OAuth. Tools that change state need your approval in the dashboard before they run.
10
+
11
+ ## Remote vs. CLI
12
+
13
+ The [CLI MCP server](/mcp-introduction) runs on your machine through `npx trigger.dev@latest mcp`. The remote server runs on Trigger.dev and has no access to your local files or processes.
14
+
15
+ Use the remote server when your client supports HTTP MCP servers, or when you cannot install the CLI. Keep the CLI server for anything that touches your machine. These tools exist only in the CLI server:
16
+
17
+ - `deploy`
18
+ - `start_dev_server`, `stop_dev_server`, `dev_server_status`
19
+ - `whoami`, `list_profiles`, `switch_profile`
20
+ - `initialize_project`
21
+
22
+ Every other tool on the [tools page](/mcp-tools) is available remotely. The endpoint accepts POST only. Other methods return `405`.
23
+
24
+ ## Connect with OAuth
25
+
26
+ OAuth is the default. Your client opens a browser, you approve access on a consent page, and the client stores the tokens.
27
+
28
+ <Tabs>
29
+ <Tab title="Claude Code">
30
+ ```bash
31
+ claude mcp add --transport http trigger https://mcp.trigger.dev/mcp
32
+ ```
33
+
34
+ Run `/mcp` in Claude Code and choose **Authenticate** for `trigger`.
35
+ </Tab>
36
+ <Tab title="Cursor">
37
+ ```json .cursor/mcp.json
38
+ {
39
+ "mcpServers": {
40
+ "trigger": {
41
+ "url": "https://mcp.trigger.dev/mcp"
42
+ }
43
+ }
44
+ }
45
+ ```
46
+ </Tab>
47
+ <Tab title="claude.ai">
48
+ Open **Settings**, then **Connectors**, and add a custom connector with the URL `https://mcp.trigger.dev/mcp`.
49
+ </Tab>
50
+ </Tabs>
51
+
52
+ The server publishes its protected resource metadata at `/.well-known/oauth-protected-resource`. Clients find the authorization server from there. It supports dynamic client registration, client ID metadata documents, and PKCE with `S256`. Composio and similar platforms connect the same way as any other client, through dynamic client registration.
53
+
54
+ An OAuth grant stops working after 30 days without use, and 90 days after it was created. Self-hosters can change both limits (see [self-hosting](#self-hosting)). When a grant expires, the client prompts you to sign in again.
55
+
56
+ ## Scopes
57
+
58
+ Each OAuth grant carries a list of scopes. A tool call is denied if the scopes or your role in the organization don't allow it.
59
+
60
+ | Kind | Scopes |
61
+ | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
62
+ | Read | `read:alerts`, `read:branches`, `read:deployments`, `read:organizations`, `read:projects`, `read:prompts`, `read:query`, `read:runs`, `read:sessions`, `read:webhooks` |
63
+ | Write | `trigger:tasks`, `update:prompts`, `write:alerts`, `write:projects`, `write:query`, `write:runs`, `write:sessions`, `write:webhooks` |
64
+
65
+ ## Write confirmation
66
+
67
+ Every tool that changes state asks you to approve the exact call first, such as `trigger_task`, `cancel_run`, `replay_run`, or `create_alert`. Read tools never ask.
68
+
69
+ 1. The assistant calls the tool. The server doesn't run it and returns a confirmation link instead.
70
+ 2. Open the link and sign in to the dashboard. The page shows the tool, the organization, project, and environment, and the arguments. Values under keys like `secret`, `token`, or `password` are hidden.
71
+ 3. Select **Approve**.
72
+ 4. Tell the assistant to retry. It calls the same tool with identical arguments, and the call runs once.
73
+
74
+ An approval expires after 10 minutes. It only applies to the same user, token, tool, and arguments, so changing an argument asks again.
75
+
76
+ By default the link comes back as a URL elicitation error, which clients that support it show as a prompt. With `MCP_CONFIRMATION_ERROR_MODE=tool-error` it comes back as a normal tool error with the link in the message.
77
+
78
+ ## Self-hosting
79
+
80
+ The remote server is off by default. Set these environment variables on the webapp:
81
+
82
+ | Variable | Meaning |
83
+ | ----------------------------- | ------------------------------------------------------------------------------------------------- |
84
+ | `MCP_SERVER_ENABLED` | Turns on the `/mcp` endpoint and the OAuth server. Default `false`. |
85
+ | `MCP_ORIGIN` | Origin the MCP server is reached on. Defaults to `APP_ORIGIN`. |
86
+ | `MCP_CONFIRMATION_ERROR_MODE` | How a pending confirmation is reported: `rpc-error` (default) or `tool-error`. |
87
+ | `OAUTH_GRANT_IDLE_DAYS` | Days without use before an OAuth grant stops working. Default `30`. |
88
+ | `OAUTH_GRANT_ABSOLUTE_DAYS` | Maximum lifetime in days of an OAuth grant. Default `90`. |
89
+
90
+ Confirmations are stored in the cache Redis, so the webapp needs the `CACHE_REDIS_*` variables.
@@ -0,0 +1,81 @@
1
+ ---
2
+ title: "Connect to Microsoft Azure"
3
+ sidebarTitle: "Azure"
4
+ description: "Authenticate to Azure from your tasks with a federated identity credential instead of a client secret or certificate."
5
+ ---
6
+
7
+ Use Microsoft Entra [workload identity federation](https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation) to exchange a Trigger.dev OIDC token for an Entra access token. Your tasks authenticate as an app registration with no `AZURE_CLIENT_SECRET` or client certificate stored anywhere.
8
+
9
+ Follow the [OIDC prerequisites](/oidc#prerequisites), then go to the [OIDC](https://cloud.trigger.dev/_/oidc) page for your environment and copy the issuer URL and subject.
10
+
11
+ ## Configure Azure
12
+
13
+ 1. [Register an app](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app) in Microsoft Entra ID, or reuse one, and grant it access to the Azure resources your task uses (for the example below, the **Storage Blob Data Reader** role on a storage account).
14
+ 2. In the app registration, open **Certificates & secrets**, select the **Federated credentials** tab, select **Add credential**, and choose the **Other issuer** scenario. Fill in the [federated identity credential](https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation-create-trust):
15
+
16
+ | Azure field | Value |
17
+ | ---------------------- | --------------------------------------------------------------------------- |
18
+ | **Issuer** | Your issuer URL, `https://oidc.trigger.dev/YOUR_ORG_SLUG`. |
19
+ | **Subject identifier** | The **complete subject copied from the dashboard**. |
20
+ | **Audience** | `api://AzureADTokenExchange`, Microsoft's recommended value. |
21
+ | **Name** | A name for the credential, for example `trigger-production`. |
22
+
23
+ 3. Copy the app's **Application (client) ID** and **Directory (tenant) ID** from its **Overview** page.
24
+
25
+ Azure compares the issuer and subject exactly and doesn't support wildcards, so each environment needs its own federated credential. An app registration holds at most 20 federated credentials, so use one app per group of environments rather than one credential per Preview branch.
26
+
27
+ ## Use the credential in your task
28
+
29
+ <CodeGroup>
30
+
31
+ ```bash npm
32
+ npm i @trigger.dev/sdk@latest @azure/identity @azure/storage-blob
33
+ ```
34
+
35
+ ```bash pnpm
36
+ pnpm add @trigger.dev/sdk@latest @azure/identity @azure/storage-blob
37
+ ```
38
+
39
+ ```bash bun
40
+ bun add @trigger.dev/sdk@latest @azure/identity @azure/storage-blob
41
+ ```
42
+
43
+ </CodeGroup>
44
+
45
+ `ClientAssertionCredential` from `@azure/identity` calls your function whenever it needs a new Entra token. Return a fresh Trigger.dev OIDC token from it:
46
+
47
+ ```ts /trigger/read-from-azure.ts
48
+ import { auth, task } from "@trigger.dev/sdk";
49
+ import { ClientAssertionCredential } from "@azure/identity";
50
+ import { BlobServiceClient } from "@azure/storage-blob";
51
+
52
+ export const readFromAzure = task({
53
+ id: "read-from-azure",
54
+ run: async () => {
55
+ const credential = new ClientAssertionCredential(
56
+ "YOUR_TENANT_ID",
57
+ "YOUR_CLIENT_ID",
58
+ async () => (await auth.getOIDCToken({ audience: "api://AzureADTokenExchange" })).token
59
+ );
60
+
61
+ const blobs = new BlobServiceClient(
62
+ "https://YOUR_STORAGE_ACCOUNT.blob.core.windows.net",
63
+ credential
64
+ );
65
+ const blob = blobs.getContainerClient("YOUR_CONTAINER").getBlobClient("example.txt");
66
+ const contents = await blob.downloadToBuffer();
67
+
68
+ return { contents: contents.toString() };
69
+ },
70
+ });
71
+ ```
72
+
73
+ The tenant and client IDs aren't secrets. Keep them in `AZURE_TENANT_ID` and `AZURE_CLIENT_ID` if you prefer.
74
+
75
+ Create the credential inside `run` so one run's tokens are never reused by another. Redeploy and start a new run on that deployment.
76
+
77
+ ## Remove the old credential
78
+
79
+ Once runs in every deployed environment authenticate this way, delete `AZURE_CLIENT_SECRET`, `AZURE_CLIENT_CERTIFICATE_PATH`, and `AZURE_CLIENT_CERTIFICATE_PASSWORD` from those environments on the Environment Variables page, then delete the secret or certificate from the app registration.
80
+
81
+ Local Development runs can't mint OIDC tokens. Use your own Azure sign-in there, such as `DefaultAzureCredential` with the Azure CLI, when `ctx.environment.type === "DEVELOPMENT"`.
@@ -0,0 +1,99 @@
1
+ ---
2
+ title: "Connect to Databricks"
3
+ sidebarTitle: "Databricks"
4
+ description: "Authenticate to Databricks from your tasks with a federation policy instead of a personal access token or client secret."
5
+ ---
6
+
7
+ Use Databricks [workload identity federation](https://docs.databricks.com/aws/dev-tools/auth/oauth-federation-policy) to exchange a Trigger.dev OIDC token for a Databricks OAuth token. Your tasks run queries as a service principal with no `DATABRICKS_TOKEN` or `DATABRICKS_CLIENT_SECRET` stored anywhere.
8
+
9
+ Follow the [OIDC prerequisites](/oidc#prerequisites), then go to the [OIDC](https://cloud.trigger.dev/_/oidc) page for your environment and copy the issuer URL and subject.
10
+
11
+ ## Configure Databricks
12
+
13
+ Create a service principal (or reuse one), grant it access to the warehouse and data your task uses, and add a federation policy with the Databricks CLI. Replace the numeric service principal ID, your organization slug, account ID, and the subject:
14
+
15
+ ```bash
16
+ databricks account service-principal-federation-policy create YOUR_SERVICE_PRINCIPAL_NUMERIC_ID --json '{
17
+ "oidc_policy": {
18
+ "issuer": "https://oidc.trigger.dev/YOUR_ORG_SLUG",
19
+ "audiences": ["YOUR_DATABRICKS_ACCOUNT_ID"],
20
+ "subject": "YOUR_ENVIRONMENT_SUBJECT"
21
+ }
22
+ }'
23
+ ```
24
+
25
+ Use the **complete subject copied from the dashboard**. The audience shown is Databricks' default; any value works if the task requests the same one. A service principal holds at most 20 federation policies.
26
+
27
+ ## Query Databricks in your task
28
+
29
+ <CodeGroup>
30
+
31
+ ```bash npm
32
+ npm i @trigger.dev/sdk@latest @databricks/sql
33
+ ```
34
+
35
+ ```bash pnpm
36
+ pnpm add @trigger.dev/sdk@latest @databricks/sql
37
+ ```
38
+
39
+ ```bash bun
40
+ bun add @trigger.dev/sdk@latest @databricks/sql
41
+ ```
42
+
43
+ </CodeGroup>
44
+
45
+ Exchange the OIDC token at your workspace's [token endpoint](https://docs.databricks.com/aws/en/dev-tools/auth/oauth-federation-exchange), then pass the access token to the SQL driver:
46
+
47
+ ```ts /trigger/query-databricks.ts
48
+ import { auth, task } from "@trigger.dev/sdk";
49
+ import { DBSQLClient } from "@databricks/sql";
50
+
51
+ const host = "YOUR_WORKSPACE.cloud.databricks.com";
52
+
53
+ export const queryDatabricks = task({
54
+ id: "query-databricks",
55
+ run: async () => {
56
+ const { token: subjectToken } = await auth.getOIDCToken({
57
+ audience: "YOUR_DATABRICKS_ACCOUNT_ID",
58
+ });
59
+
60
+ const exchange = await fetch(`https://${host}/oidc/v1/token`, {
61
+ method: "POST",
62
+ body: new URLSearchParams({
63
+ client_id: "YOUR_SERVICE_PRINCIPAL_UUID",
64
+ subject_token: subjectToken,
65
+ subject_token_type: "urn:ietf:params:oauth:token-type:jwt",
66
+ grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
67
+ scope: "all-apis",
68
+ }),
69
+ });
70
+ if (!exchange.ok) throw new Error(`Databricks exchange failed: ${exchange.status}`);
71
+ const { access_token } = await exchange.json();
72
+
73
+ const client = new DBSQLClient();
74
+ await client.connect({ host, path: "/sql/1.0/warehouses/YOUR_WAREHOUSE_ID", token: access_token });
75
+ const session = await client.openSession();
76
+ const operation = await session.executeStatement("SELECT current_user()");
77
+ const rows = await operation.fetchAll();
78
+ await operation.close();
79
+ await session.close();
80
+ await client.close();
81
+
82
+ return { rows };
83
+ },
84
+ });
85
+ ```
86
+
87
+ `client_id` is the service principal's UUID (its application ID), not the numeric ID used in the CLI command.
88
+
89
+ <Note>
90
+ The Databricks access token expires when the OIDC token it was exchanged for does, which is five
91
+ minutes for Trigger.dev tokens, and there's no refresh token. For longer work, request a new OIDC
92
+ token and exchange it again.
93
+ </Note>
94
+
95
+ ## Remove the old credential
96
+
97
+ Once runs in every deployed environment authenticate this way, delete `DATABRICKS_TOKEN` and `DATABRICKS_CLIENT_SECRET` from those environments on the Environment Variables page, then revoke the token or OAuth secret in Databricks.
98
+
99
+ Local Development runs can't mint OIDC tokens. Use your own Databricks login there when `ctx.environment.type === "DEVELOPMENT"`.
@@ -0,0 +1,60 @@
1
+ ---
2
+ title: "Connect to Doppler"
3
+ sidebarTitle: "Doppler"
4
+ description: "Fetch secrets from Doppler in your tasks with a service account identity instead of a stored Doppler token."
5
+ ---
6
+
7
+ Use a Doppler [service account identity](https://docs.doppler.com/docs/service-account-identities) to exchange a Trigger.dev OIDC token for a short-lived Doppler API token. Your tasks fetch secrets with no `DOPPLER_TOKEN` stored anywhere. Service account identities are available on Doppler's Team and Enterprise plans.
8
+
9
+ Follow the [OIDC prerequisites](/oidc#prerequisites), then go to the [OIDC](https://cloud.trigger.dev/_/oidc) page for your environment and copy the issuer URL and subject.
10
+
11
+ ## Configure Doppler
12
+
13
+ 1. In Doppler, create a service account (or reuse one) and give it read access to the project and config your task needs.
14
+ 2. On the service account, add an **Identity** of type OIDC with a custom discovery URL:
15
+
16
+ | Doppler field | Value |
17
+ | ----------------- | ------------------------------------------------------------------------ |
18
+ | **Discovery URL** | Your issuer URL, `https://oidc.trigger.dev/YOUR_ORG_SLUG`. |
19
+ | **Audience** (`aud`) | A value your task requests, for example `https://api.doppler.com`. |
20
+ | **Subject** (`sub`) | The **complete subject copied from the dashboard**. |
21
+
22
+ Doppler requires both the audience and subject claim rules. Use exact values.
23
+
24
+ 3. Copy the **Identity ID**. It's a configuration value, not a secret.
25
+
26
+ ## Fetch secrets in your task
27
+
28
+ ```ts /trigger/read-from-doppler.ts
29
+ import { auth, task } from "@trigger.dev/sdk";
30
+
31
+ export const readFromDoppler = task({
32
+ id: "read-from-doppler",
33
+ run: async () => {
34
+ const { token: oidcToken } = await auth.getOIDCToken({ audience: "https://api.doppler.com" });
35
+
36
+ const exchange = await fetch("https://api.doppler.com/v3/auth/oidc", {
37
+ method: "POST",
38
+ headers: { "Content-Type": "application/json" },
39
+ body: JSON.stringify({ identity: "YOUR_IDENTITY_ID", token: oidcToken }),
40
+ });
41
+ if (!exchange.ok) throw new Error(`Doppler exchange failed: ${exchange.status}`);
42
+ const { token } = await exchange.json();
43
+
44
+ const response = await fetch(
45
+ "https://api.doppler.com/v3/configs/config/secrets/download?project=YOUR_PROJECT&config=prd&format=json",
46
+ { headers: { Authorization: `Bearer ${token}` } }
47
+ );
48
+ const secrets = await response.json();
49
+ // Use secrets.API_KEY here. Never log or return it.
50
+ },
51
+ });
52
+ ```
53
+
54
+ The exchange returns a short-lived API `token` and its `expires_at`. The second request uses Doppler's [download secrets](https://docs.doppler.com/reference/secrets-download) endpoint. Exchange inside `run`, and exchange again if the run outlives `expires_at`.
55
+
56
+ ## Remove the old credential
57
+
58
+ Once runs in every deployed environment fetch secrets this way, delete `DOPPLER_TOKEN` from those environments on the Environment Variables page and revoke the old service token in Doppler.
59
+
60
+ Local Development runs can't mint OIDC tokens. Use the Doppler CLI or your own token there when `ctx.environment.type === "DEVELOPMENT"`.