Skip to content

Commit e9461cb

Browse files
jackbridgerTrigger.dev RepoOps
authored andcommitted
docs: fix wrong samples, stale versions and broken links
Mono-RevId: 2d5b07185b7b1fcb69510e69799c937bccb5e6e1
1 parent 173ab20 commit e9461cb

16 files changed

Lines changed: 66 additions & 59 deletions

‎docs/ai-chat/reference.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: "Complete API reference for the AI Agents SDK — backend options,
99
| Dependency | Supported | Notes |
1010
|---|---|---|
1111
| `@trigger.dev/sdk` | `>=4.5.0` | The chat agent surface lives in this SDK release. Install with `@trigger.dev/sdk@latest`. |
12-
| `ai` (Vercel AI SDK) | `^5.0.0 \|\| ^6.0.0 \|\| >=7.0.0-canary <8` | Declared as a peer. v6 is what we develop against day to day; v5 and v7 work too (v7 is in canary/beta upstream). Your installed `ai` major drives the chat surface's types. |
12+
| `ai` (Vercel AI SDK) | `^5.0.0 \|\| ^6.0.0 \|\| >=7.0.0-canary <8` | Declared as a peer. v6 is what we develop against day to day; v5 and v7 work too. Your installed `ai` major drives the chat surface's types. |
1313
| `@ai-sdk/otel` | `1.x` (v7 only) | Optional. AI SDK 7 moved model-call span emission out of `ai` core into this adapter. Install it alongside `ai@7` and the SDK auto-registers it, so your model calls show up as spans in the run trace. Not needed on v5/v6, where `ai` core emits spans. See [AI SDK 7 telemetry](#ai-sdk-7-telemetry) below. |
1414
| `@ai-sdk/react` | matches your `ai` major | Pulled in by `useChat`. The transport works with whichever React hook ships in the same major as your `ai` version. |
1515
| `react` | `^18.0 \|\| ^19.0` | Required only if you use `@trigger.dev/sdk/chat/react` (the frontend transport). Server-only consumers can skip React entirely. |

‎docs/cli-init-commands.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ yarn dlx trigger.dev@latest init
6262
</ParamField>
6363

6464
<ParamField body="Runtime" type="-r, --runtime <runtime>">
65-
The runtime to use: `node`, `node-22`, `node-24`, `node-26` or `bun`. Defaults to `node-24`.
65+
The runtime to use: `node`, `node-22`, `node-24`, `node-26`, `bun-1.4` or `bun` (deprecated). Defaults to `node-24`.
6666
</ParamField>
6767

6868
<ParamField body="Yes" type="-y, --yes">

‎docs/config/extensions/prismaExtension.mdx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Use this decision tree to determine which mode is right for your project:
5050

5151
```mermaid
5252
flowchart TD
53-
Start([Which mode should I use?]) --> Q1{Using Prisma 7 or<br/>6.20+ beta?}
53+
Start([Which mode should I use?]) --> Q1{Using Prisma 7?}
5454
Q1 -->|Yes| Modern[Modern Mode]
5555
Q1 -->|No| Q2{Using Prisma 6.16+<br/>with engineType='client'?}
5656
Q2 -->|Yes| Modern
@@ -210,7 +210,7 @@ prismaExtension({
210210
- Designed for the new Prisma architecture
211211
- Zero configuration required
212212
- Automatically marks `@prisma/client` as external
213-
- Works with Prisma 7 beta releases & Prisma 7 when released
213+
- Works with Prisma 7
214214
- You manage client generation (like engine-only mode)
215215

216216
**Schema configuration (Prisma 6.16+ with engineType):**
@@ -272,7 +272,7 @@ export default defineConfig({
272272
**Important notes:**
273273

274274
- You **must** run `prisma generate` yourself.
275-
- Requires Prisma 6.16.0+ or Prisma 7 beta
275+
- Requires Prisma 6.16.0+ or Prisma 7
276276
- The new `prisma-client` provider generates plain TypeScript (no Rust binaries)
277277
- Requires database adapters (e.g., `@prisma/adapter-pg` for PostgreSQL)
278278

@@ -331,7 +331,7 @@ steps:
331331
- name: Generate Prisma client
332332
run: npx prisma@6.19.0 generate
333333
- name: Deploy Trigger.dev
334-
run: npx trigger.dev@4.1.1 deploy --env prod
334+
run: npx trigger.dev@latest deploy --env prod
335335
env:
336336
TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
337337
```
@@ -352,7 +352,7 @@ If you are using the [Trigger.dev Github integration](/github-integration), you
352352
| 5.0 - 6.15 | Legacy | Standard Prisma setup |
353353
| 6.7+ | Legacy | Multi-file schema support |
354354
| 6.16+ | Engine-only or Modern | Modern mode requires `engineType = "client"` |
355-
| 6.20+ (7.0 beta) | Modern | Prisma 7 with new architecture |
355+
| 7.0+ | Modern | Prisma 7 with new architecture |
356356

357357
---
358358

@@ -1008,6 +1008,6 @@ export const db = new PrismaClient({ adapter });
10081008
- [Prisma Documentation](https://www.prisma.io/docs)
10091009
- [Multi-File Schema (Prisma 6.7+)](https://www.prisma.io/docs/orm/prisma-schema/overview/location#multi-file-prisma-schema)
10101010
- [TypedSQL (Prisma 5.19+)](https://www.prisma.io/docs/orm/prisma-client/using-raw-sql/typedsql)
1011-
- [Prisma 7 Beta Documentation](https://www.prisma.io/docs)
1011+
- [Prisma 7 Documentation](https://www.prisma.io/docs)
10121012

10131013
---

‎docs/deployment/preview-branches.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ jobs:
115115
steps:
116116
- uses: actions/checkout@v4
117117

118-
- name: Use Node.js 20.x
118+
- name: Use Node.js 24.x
119119
uses: actions/setup-node@v4
120120
with:
121-
node-version: "20.x"
121+
node-version: "24.x"
122122

123123
- name: Install dependencies
124124
run: npm install

‎docs/github-actions.mdx‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
steps:
3636
- uses: actions/checkout@v4
3737

38-
- name: Use Node.js 20.x
38+
- name: Use Node.js 24.x
3939
uses: actions/setup-node@v4
4040
with:
41-
node-version: "20.x"
41+
node-version: "24.x"
4242

4343
- name: Install dependencies
4444
run: npm install
@@ -64,10 +64,10 @@ jobs:
6464
steps:
6565
- uses: actions/checkout@v4
6666

67-
- name: Use Node.js 20.x
67+
- name: Use Node.js 24.x
6868
uses: actions/setup-node@v4
6969
with:
70-
node-version: "20.x"
70+
node-version: "24.x"
7171

7272
- name: Install dependencies
7373
run: npm install
@@ -124,10 +124,10 @@ jobs:
124124
steps:
125125
- uses: actions/checkout@v4
126126
127-
- name: Use Node.js 20.x
127+
- name: Use Node.js 24.x
128128
uses: actions/setup-node@v4
129129
with:
130-
node-version: "20.x"
130+
node-version: "24.x"
131131
132132
- name: Install dependencies
133133
run: npm install
@@ -188,7 +188,7 @@ Tip: add the `trigger.dev` CLI to your `devDependencies` and the deploy command
188188
"deploy:trigger": "trigger deploy --env staging"
189189
},
190190
"devDependencies": {
191-
"trigger.dev": "4.7.0"
191+
"trigger.dev": "4.8.5"
192192
}
193193
}
194194
```
@@ -230,10 +230,10 @@ jobs:
230230
steps:
231231
- uses: actions/checkout@v4
232232
233-
- name: Use Node.js 20.x
233+
- name: Use Node.js 24.x
234234
uses: actions/setup-node@v4
235235
with:
236-
node-version: "20.x"
236+
node-version: "24.x"
237237
238238
- name: Install dependencies
239239
run: npm install

‎docs/how-it-works.mdx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ All these commands work with the Trigger.dev cloud and/or your self-hosted insta
118118

119119
```sh
120120
npx trigger.dev@latest login --profile <profile> -a https://trigger.example.com # Log in to a specific profile into a self-hosted instance
121-
npx trigger.dev@latest dev --profile <profile> # Initialize Trigger.dev in your project
121+
npx trigger.dev@latest dev --profile <profile> # Run your tasks locally
122122
npx trigger.dev@latest deploy --profile <profile> # Deploy your tasks to the Trigger.dev instance
123123
```
124124

@@ -408,7 +408,7 @@ When you run `npx trigger.dev@latest deploy` or `npx trigger.dev@latest dev`, we
408408

409409
- **Bundled by default**: Code + dependencies are bundled and tree-shaked by default.
410410
- **Build extensions**: Use and write custom build extensions to transform your code or the resulting docker image.
411-
- **ESM ouput**: We output to ESM, which allows tree-shaking and better performance.
411+
- **ESM output**: We output to ESM, which allows tree-shaking and better performance.
412412

413413
You can review the build output by running deploy with the `--dry-run` flag, which will output the Containerfile and the build output.
414414

@@ -451,7 +451,9 @@ import { AwsInstrumentation } from "@opentelemetry/instrumentation-aws-sdk";
451451

452452
export default defineConfig({
453453
project: "<your-project-ref>",
454-
instrumentations: [new PrismaInstrumentation(), new AwsInstrumentation()],
455454
maxDuration: 3600,
455+
telemetry: {
456+
instrumentations: [new PrismaInstrumentation(), new AwsInstrumentation()],
457+
},
456458
});
457459
```

‎docs/limits.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ Additional bundles above the Pro tier are available for $10/month per preview br
107107
| Pricing tier | Limit |
108108
| :----------- | :-------------------------- |
109109
| Free | 10 concurrent connections |
110-
| Hobby | 50 concurrent connections |
111-
| Pro | 500+ concurrent connections |
110+
| Hobby | 150 concurrent connections |
111+
| Pro | 1,000+ concurrent connections |
112112

113-
Additional bundles are available for $10/month per 100 concurrent connections. Contact us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord) to request more.
113+
Additional bundles are available for $10/month per 1,000 concurrent connections. Contact us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord) to request more.
114114

115115
## Task payloads and outputs
116116

‎docs/management/overview.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ yarn add @trigger.dev/sdk@latest
2626

2727
## Usage
2828

29-
All `v3` functionality is provided through the `@trigger.dev/sdk` module. You can import the entire module or individual resources as needed.
29+
All functionality is provided through the `@trigger.dev/sdk` module. You can import the entire module or individual resources as needed.
3030

3131
```ts
3232
import { configure, runs } from "@trigger.dev/sdk";

‎docs/manual-setup.mdx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default defineConfig({
146146

147147
// Retry configuration
148148
retries: {
149-
enabledInDev: false, // Enable retries in development
149+
enabledInDev: true, // Enable retries in development
150150
default: {
151151
maxAttempts: 3,
152152
minTimeoutInMs: 1000,
@@ -175,7 +175,7 @@ import { defineConfig } from "@trigger.dev/sdk";
175175

176176
export default defineConfig({
177177
project: "<your-project-ref>",
178-
runtime: "bun",
178+
runtime: "bun-1.4",
179179
dirs: ["./src/trigger"],
180180
maxDuration: 3600,
181181
});
@@ -259,10 +259,10 @@ bun add @trigger.dev/react-hooks@latest
259259
```typescript
260260
import { auth } from "@trigger.dev/sdk";
261261

262-
// In your backend API
263-
export async function getPublicAccessToken() {
262+
// In your backend API, after checking the user can access this run
263+
export async function getPublicAccessToken(runId: string) {
264264
const publicAccessToken = await auth.createPublicToken({
265-
scopes: ["read:runs"], // Customize based on needs
265+
scopes: { read: { runs: [runId] } }, // Only this run
266266
});
267267

268268
return publicAccessToken;
@@ -291,7 +291,7 @@ export function TaskStatus({
291291
return (
292292
<div>
293293
<p>Status: {run.status}</p>
294-
<p>Progress: {run.completedAt ? "Complete" : "Running..."}</p>
294+
<p>Progress: {run.isCompleted ? "Complete" : "Running..."}</p>
295295
</div>
296296
);
297297
}

‎docs/migrating-from-v3.mdx‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Trigger.dev v3 is end of life. v4 is stable, fully supported, and recommended fo
3030
| [onComplete](/tasks/overview#oncomplete-function) | Run code when a run completes, regardless of whether it succeeded or failed. |
3131
| [onCancel](/tasks/overview#oncancel-function) | Run code when a run is cancelled. |
3232
| [Hidden tasks](/hidden-tasks) | Create tasks that are not exported from your trigger files but can still be executed. |
33-
| [Middleware & locals](#middleware-and-locals) | The middleware system runs at the top level, executing before and after all lifecycle hooks. The locals API allows sharing data between middleware and hooks. |
33+
| [Middleware & locals](/tasks/overview#middleware-and-locals-functions) | The middleware system runs at the top level, executing before and after all lifecycle hooks. The locals API allows sharing data between middleware and hooks. |
3434
| [useWaitToken](/realtime/react-hooks/use-wait-token) | Use the useWaitToken hook to complete a wait token from a React component. |
3535
| [Task-backed AI tools](/tasks/schemaTask#task-backed-ai-tools) | Use `schemaTask` with AI SDK `tool()` and `ai.toolExecute()` (legacy `ai.tool` is deprecated). |
3636

@@ -260,20 +260,24 @@ import { task } from "@trigger.dev/sdk";
260260

261261
export const myTask = task({
262262
id: "my-task",
263-
onStart: ({ payload, ctx }) => {},
263+
onStartAttempt: ({ payload, ctx }) => {},
264264
// The run function still uses separate parameters
265265
run: async (payload, { ctx }) => {},
266266
});
267267
```
268268

269+
<Note>
270+
`onStart` is deprecated in favor of `onStartAttempt`. `onStart` ran once per run, but `onStartAttempt` runs before every attempt, including retries. If your hook has side effects that should only happen once, check `ctx.attempt.number === 1` inside it.
271+
</Note>
272+
269273
This is true for all the lifecycle hooks:
270274

271275
```ts
272276
import { task } from "@trigger.dev/sdk";
273277

274278
export const myTask = task({
275279
id: "my-task",
276-
onStart: ({ payload, ctx, task }) => {},
280+
onStartAttempt: ({ payload, ctx, task }) => {},
277281
onSuccess: ({ payload, ctx, task, output }) => {},
278282
onFailure: ({ payload, ctx, task, error }) => {},
279283
onWait: ({ payload, ctx, task, wait }) => {},
@@ -326,7 +330,7 @@ We are now using newer versions of the OpenTelemetry packages. This means that i
326330

327331
| Package | Previous Version | New Version | Change Type |
328332
| ----------------------------------------- | ---------------- | ----------- | ------------ |
329-
| `@opentelemetry/api-logs` | 0.52.1 | 0.203.0 | Major update |
330-
| `@opentelemetry/exporter-logs-otlp-http` | 0.52.1 | 0.203.0 | Major update |
331-
| `@opentelemetry/exporter-trace-otlp-http` | 0.52.1 | 0.203.0 | Major update |
332-
| `@opentelemetry/instrumentation` | 0.52.1 | 0.203.0 | Major update |
333+
| `@opentelemetry/api-logs` | 0.52.1 | 0.219.0 | Major update |
334+
| `@opentelemetry/exporter-logs-otlp-http` | 0.52.1 | 0.219.0 | Major update |
335+
| `@opentelemetry/exporter-trace-otlp-http` | 0.52.1 | 0.219.0 | Major update |
336+
| `@opentelemetry/instrumentation` | 0.52.1 | 0.219.0 | Major update |

0 commit comments

Comments
 (0)