Skip to content

Commit 71060d9

Browse files
authored
Removed some remaining /v3’s from the docs (#2478)
* Removed /v3 from numerous files * Fix AWS SDK v3 documentation link for S3 uploads
1 parent 89b1d8b commit 71060d9

14 files changed

+88
-86
lines changed

docs/guides/frameworks/supabase-edge-functions-basic.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Replace the placeholder code in your `edge-function-trigger/index.ts` file with
7777
// Setup type definitions for built-in Supabase Runtime APIs
7878
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
7979
// Import the Trigger.dev SDK - replace "<your-sdk-version>" with the version of the SDK you are using, e.g. "3.0.0". You can find this in your package.json file.
80-
import { tasks } from "npm:@trigger.dev/sdk@3.0.0/v3";
80+
import { tasks } from "npm:@trigger.dev/sdk@3.0.0";
8181
// Import your task type from your /trigger folder
8282
import type { helloWorldTask } from "../../../src/trigger/example.ts";
8383
// 👆 **type-only** import

docs/guides/frameworks/supabase-edge-functions-database-webhooks.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ supabase functions new video-processing-handler
330330
```ts functions/video-processing-handler/index.ts
331331
// Setup type definitions for built-in Supabase Runtime APIs
332332
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
333-
import { tasks } from "npm:@trigger.dev/sdk@latest/v3";
333+
import { tasks } from "npm:@trigger.dev/sdk@latest";
334334
// Import the videoProcessAndUpdate task from the trigger folder
335335
import type { videoProcessAndUpdate } from "../../../src/trigger/videoProcessAndUpdate.ts";
336336
// 👆 type only import

docs/guides/python/python-crawl4ai.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ After you've initialized your project with Trigger.dev, add these build settings
6262
```ts trigger.config.ts
6363
import { defineConfig } from "@trigger.dev/sdk";
6464
import { pythonExtension } from "@trigger.dev/python/extension";
65-
import type { BuildContext, BuildExtension } from "@trigger.dev/core/v3/build";
65+
import type { BuildContext, BuildExtension } from "@trigger.dev/core/build";
6666

6767
export default defineConfig({
6868
project: "<project ref>",

docs/how-to-reduce-your-spend.mdx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ description: "Tips and best practices to reduce your costs on Trigger.dev"
66
## Check out your usage page regularly
77

88
Monitor your usage dashboard to understand your spending patterns. You can see:
9+
910
- Your most expensive tasks
1011
- Your total duration by task
1112
- Number of runs by task
@@ -18,6 +19,7 @@ You can view your usage page by clicking the "Organization" menu in the top left
1819
## Create billing alerts
1920

2021
Configure billing alerts in your dashboard to get notified when you approach spending thresholds. This helps you:
22+
2123
- Catch unexpected cost increases early
2224
- Identify runaway tasks before they become expensive
2325

@@ -43,7 +45,7 @@ export const lightTask = task({
4345

4446
// Only use larger machines when necessary
4547
export const heavyTask = task({
46-
id: "heavy-task",
48+
id: "heavy-task",
4749
machine: "medium-1x", // 1 vCPU, 2 GB RAM
4850
run: async (payload) => {
4951
// CPU/memory intensive operations
@@ -64,11 +66,14 @@ export const expensiveApiCall = task({
6466
id: "expensive-api-call",
6567
run: async (payload: { userId: string }) => {
6668
// This expensive operation will only run once per user
67-
await wait.for({ seconds: 30 }, {
68-
idempotencyKey: `user-processing-${payload.userId}`,
69-
idempotencyKeyTTL: "1h"
70-
});
71-
69+
await wait.for(
70+
{ seconds: 30 },
71+
{
72+
idempotencyKey: `user-processing-${payload.userId}`,
73+
idempotencyKeyTTL: "1h",
74+
}
75+
);
76+
7277
const result = await processUserData(payload.userId);
7378
return result;
7479
},
@@ -105,7 +110,7 @@ export const processItems = task({
105110
id: "process-items",
106111
run: async (payload: { items: string[] }) => {
107112
// Process all items in parallel
108-
const promises = payload.items.map(item => processItem(item));
113+
const promises = payload.items.map((item) => processItem(item));
109114
// This works very well for API calls
110115
await Promise.all(promises);
111116
},
@@ -133,7 +138,7 @@ export const apiTask = task({
133138
This is very useful for intermittent errors, but if there's a permanent error you don't want to retry because you will just keep failing and waste compute. Use [AbortTaskRunError](/errors-retrying#using-aborttaskrunerror) to prevent a retry:
134139

135140
```ts
136-
import { task, AbortTaskRunError } from "@trigger.dev/sdk/v3";
141+
import { task, AbortTaskRunError } from "@trigger.dev/sdk";
137142

138143
export const someTask = task({
139144
id: "some-task",
@@ -145,13 +150,11 @@ export const someTask = task({
145150
throw new AbortTaskRunError(result.error);
146151
}
147152

148-
return result
153+
return result;
149154
},
150155
});
151156
```
152157

153-
154-
155158
## Use appropriate maxDuration settings
156159

157160
Set realistic maxDurations to prevent runs from executing for too long:

docs/realtime/auth.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You can create a Public Access Token using the `auth.createPublicToken` function
2323

2424
```tsx
2525
// Somewhere in your backend code
26-
import { auth } from "@trigger.dev/sdk/v3";
26+
import { auth } from "@trigger.dev/sdk";
2727

2828
const publicToken = await auth.createPublicToken(); // 👈 this public access token has no permissions, so is pretty useless!
2929
```
@@ -33,7 +33,7 @@ const publicToken = await auth.createPublicToken(); // 👈 this public access t
3333
By default a Public Access Token has no permissions. You must specify the scopes you need when creating a Public Access Token:
3434

3535
```ts
36-
import { auth } from "@trigger.dev/sdk/v3";
36+
import { auth } from "@trigger.dev/sdk";
3737

3838
const publicToken = await auth.createPublicToken({
3939
scopes: {
@@ -47,7 +47,7 @@ const publicToken = await auth.createPublicToken({
4747
This will allow the token to read all runs, which is probably not what you want. You can specify only certain runs by passing an array of run IDs:
4848

4949
```ts
50-
import { auth } from "@trigger.dev/sdk/v3";
50+
import { auth } from "@trigger.dev/sdk";
5151

5252
const publicToken = await auth.createPublicToken({
5353
scopes: {
@@ -61,7 +61,7 @@ const publicToken = await auth.createPublicToken({
6161
You can scope the token to only read certain tasks:
6262

6363
```ts
64-
import { auth } from "@trigger.dev/sdk/v3";
64+
import { auth } from "@trigger.dev/sdk";
6565

6666
const publicToken = await auth.createPublicToken({
6767
scopes: {
@@ -75,7 +75,7 @@ const publicToken = await auth.createPublicToken({
7575
Or tags:
7676

7777
```ts
78-
import { auth } from "@trigger.dev/sdk/v3";
78+
import { auth } from "@trigger.dev/sdk";
7979

8080
const publicToken = await auth.createPublicToken({
8181
scopes: {
@@ -89,7 +89,7 @@ const publicToken = await auth.createPublicToken({
8989
Or a specific batch of runs:
9090

9191
```ts
92-
import { auth } from "@trigger.dev/sdk/v3";
92+
import { auth } from "@trigger.dev/sdk";
9393

9494
const publicToken = await auth.createPublicToken({
9595
scopes: {
@@ -103,7 +103,7 @@ const publicToken = await auth.createPublicToken({
103103
You can also combine scopes. For example, to read runs with specific tags and for specific tasks:
104104

105105
```ts
106-
import { auth } from "@trigger.dev/sdk/v3";
106+
import { auth } from "@trigger.dev/sdk";
107107

108108
const publicToken = await auth.createPublicToken({
109109
scopes: {
@@ -120,7 +120,7 @@ const publicToken = await auth.createPublicToken({
120120
By default, Public Access Token's expire after 15 minutes. You can specify a different expiration time when creating a Public Access Token:
121121

122122
```ts
123-
import { auth } from "@trigger.dev/sdk/v3";
123+
import { auth } from "@trigger.dev/sdk";
124124

125125
const publicToken = await auth.createPublicToken({
126126
expirationTime: "1hr",
@@ -156,7 +156,7 @@ For triggering tasks from your frontend, you need special "trigger" tokens. Thes
156156
### Creating Trigger Tokens
157157

158158
```ts
159-
import { auth } from "@trigger.dev/sdk/v3";
159+
import { auth } from "@trigger.dev/sdk";
160160

161161
// Somewhere in your backend code
162162
const triggerToken = await auth.createTriggerPublicToken("my-task");
@@ -167,7 +167,7 @@ const triggerToken = await auth.createTriggerPublicToken("my-task");
167167
You can pass multiple tasks to create a token that can trigger multiple tasks:
168168

169169
```ts
170-
import { auth } from "@trigger.dev/sdk/v3";
170+
import { auth } from "@trigger.dev/sdk";
171171

172172
// Somewhere in your backend code
173173
const triggerToken = await auth.createTriggerPublicToken(["my-task-1", "my-task-2"]);
@@ -178,7 +178,7 @@ const triggerToken = await auth.createTriggerPublicToken(["my-task-1", "my-task-
178178
You can also create tokens that can be used multiple times:
179179

180180
```ts
181-
import { auth } from "@trigger.dev/sdk/v3";
181+
import { auth } from "@trigger.dev/sdk";
182182

183183
// Somewhere in your backend code
184184
const triggerToken = await auth.createTriggerPublicToken("my-task", {
@@ -191,7 +191,7 @@ const triggerToken = await auth.createTriggerPublicToken("my-task", {
191191
These tokens also expire, with the default expiration time being 15 minutes. You can specify a custom expiration time:
192192

193193
```ts
194-
import { auth } from "@trigger.dev/sdk/v3";
194+
import { auth } from "@trigger.dev/sdk";
195195

196196
// Somewhere in your backend code
197197
const triggerToken = await auth.createTriggerPublicToken("my-task", {

docs/realtime/backend/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ See our [authentication guide](/realtime/auth) for detailed information on creat
3030
Subscribe to a run:
3131

3232
```ts
33-
import { runs, tasks } from "@trigger.dev/sdk/v3";
33+
import { runs, tasks } from "@trigger.dev/sdk";
3434

3535
// Trigger a task
3636
const handle = await tasks.trigger("my-task", { some: "data" });

docs/realtime/backend/streams.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Streams use the metadata system to send data chunks in real-time. You register a
2020
Here's how to stream data from OpenAI in your task:
2121

2222
```ts
23-
import { task, metadata } from "@trigger.dev/sdk/v3";
23+
import { task, metadata } from "@trigger.dev/sdk";
2424
import OpenAI from "openai";
2525

2626
const openai = new OpenAI({
@@ -64,7 +64,7 @@ export const myTask = task({
6464
You can subscribe to the stream using the `runs.subscribeToRun` method with `.withStreams()`:
6565

6666
```ts
67-
import { runs } from "@trigger.dev/sdk/v3";
67+
import { runs } from "@trigger.dev/sdk";
6868
import type { myTask, STREAMS } from "./trigger/my-task";
6969

7070
// Somewhere in your backend
@@ -91,7 +91,7 @@ async function subscribeToStream(runId: string) {
9191
You can register and subscribe to multiple streams in the same task:
9292

9393
```ts
94-
import { task, metadata } from "@trigger.dev/sdk/v3";
94+
import { task, metadata } from "@trigger.dev/sdk";
9595
import OpenAI from "openai";
9696

9797
const openai = new OpenAI({
@@ -138,7 +138,7 @@ export const myTask = task({
138138
Then subscribe to both streams:
139139

140140
```ts
141-
import { runs } from "@trigger.dev/sdk/v3";
141+
import { runs } from "@trigger.dev/sdk";
142142
import type { myTask, STREAMS } from "./trigger/my-task";
143143

144144
// Somewhere in your backend
@@ -170,7 +170,7 @@ The [AI SDK](https://sdk.vercel.ai/docs/introduction) provides a higher-level AP
170170

171171
```ts
172172
import { openai } from "@ai-sdk/openai";
173-
import { logger, metadata, runs, schemaTask } from "@trigger.dev/sdk/v3";
173+
import { logger, metadata, runs, schemaTask } from "@trigger.dev/sdk";
174174
import { streamText } from "ai";
175175
import { z } from "zod";
176176

@@ -215,7 +215,7 @@ When using tools with the AI SDK, you can access tool calls and results using th
215215

216216
```ts
217217
import { openai } from "@ai-sdk/openai";
218-
import { logger, metadata, runs, schemaTask } from "@trigger.dev/sdk/v3";
218+
import { logger, metadata, runs, schemaTask } from "@trigger.dev/sdk";
219219
import { streamText, tool, type TextStreamPart } from "ai";
220220
import { z } from "zod";
221221

@@ -283,7 +283,7 @@ You can define a Trigger.dev task that can be used as a tool, and will automatic
283283

284284
```ts
285285
import { openai } from "@ai-sdk/openai";
286-
import { logger, metadata, runs, schemaTask, toolTask } from "@trigger.dev/sdk/v3";
286+
import { logger, metadata, runs, schemaTask, toolTask } from "@trigger.dev/sdk";
287287
import { streamText, tool, type TextStreamPart } from "ai";
288288
import { z } from "zod";
289289

docs/realtime/backend/subscribe.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ These functions allow you to subscribe to run updates from your backend code. Ea
1111
Subscribes to all changes to a specific run.
1212

1313
```ts Example
14-
import { runs } from "@trigger.dev/sdk/v3";
14+
import { runs } from "@trigger.dev/sdk";
1515

1616
for await (const run of runs.subscribeToRun("run_1234")) {
1717
console.log(run);
@@ -29,7 +29,7 @@ This function subscribes to all changes to a run. It returns an async iterator t
2929
Subscribes to all changes to runs with a specific tag.
3030

3131
```ts Example
32-
import { runs } from "@trigger.dev/sdk/v3";
32+
import { runs } from "@trigger.dev/sdk";
3333

3434
for await (const run of runs.subscribeToRunsWithTag("user:1234")) {
3535
console.log(run);
@@ -47,7 +47,7 @@ This function subscribes to all changes to runs with a specific tag. It returns
4747
Subscribes to all changes for runs in a batch.
4848

4949
```ts Example
50-
import { runs } from "@trigger.dev/sdk/v3";
50+
import { runs } from "@trigger.dev/sdk";
5151

5252
for await (const run of runs.subscribeToBatch("batch_1234")) {
5353
console.log(run);
@@ -65,7 +65,7 @@ This function subscribes to all changes for runs in a batch. It returns an async
6565
You can infer the types of the run's payload and output by passing the type of the task to the subscribe functions:
6666

6767
```ts
68-
import { runs, tasks } from "@trigger.dev/sdk/v3";
68+
import { runs, tasks } from "@trigger.dev/sdk";
6969
import type { myTask } from "./trigger/my-task";
7070

7171
async function myBackend() {
@@ -85,7 +85,7 @@ async function myBackend() {
8585
When using `subscribeToRunsWithTag`, you can pass a union of task types:
8686

8787
```ts
88-
import { runs } from "@trigger.dev/sdk/v3";
88+
import { runs } from "@trigger.dev/sdk";
8989
import type { myTask, myOtherTask } from "./trigger/my-task";
9090

9191
for await (const run of runs.subscribeToRunsWithTag<typeof myTask | typeof myOtherTask>("my-tag")) {
@@ -130,7 +130,7 @@ This example task updates the progress of a task as it processes items.
130130

131131
```ts
132132
// Your task code
133-
import { task, metadata } from "@trigger.dev/sdk/v3";
133+
import { task, metadata } from "@trigger.dev/sdk";
134134

135135
export const progressTask = task({
136136
id: "progress-task",
@@ -165,7 +165,7 @@ We can now subscribe to the runs and receive real-time metadata updates.
165165

166166
```ts
167167
// Somewhere in your backend code
168-
import { runs } from "@trigger.dev/sdk/v3";
168+
import { runs } from "@trigger.dev/sdk";
169169
import type { progressTask } from "./trigger/progress-task";
170170

171171
async function monitorProgress(runId: string) {
@@ -199,7 +199,7 @@ For more information on how to write tasks that use the metadata API, as well as
199199
You can get type safety for your metadata by defining types:
200200

201201
```ts
202-
import { runs } from "@trigger.dev/sdk/v3";
202+
import { runs } from "@trigger.dev/sdk";
203203
import type { progressTask } from "./trigger/progress-task";
204204

205205
interface ProgressMetadata {

docs/realtime/how-it-works.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The run object returned by Realtime subscriptions is optimized for streaming upd
2525
After you trigger a task, you can subscribe to the run using the `runs.subscribeToRun` function. This function returns an async iterator that you can use to get updates on the run status.
2626

2727
```ts
28-
import { runs, tasks } from "@trigger.dev/sdk/v3";
28+
import { runs, tasks } from "@trigger.dev/sdk";
2929

3030
// Somewhere in your backend code
3131
async function myBackend() {
@@ -43,7 +43,7 @@ Every time the run changes, the async iterator will yield the updated run. You c
4343
Alternatively, you can subscribe to changes to any run that includes a specific tag (or tags) using the `runs.subscribeToRunsWithTag` function.
4444

4545
```ts
46-
import { runs } from "@trigger.dev/sdk/v3";
46+
import { runs } from "@trigger.dev/sdk";
4747

4848
// Somewhere in your backend code
4949
for await (const run of runs.subscribeToRunsWithTag("user:1234")) {
@@ -55,7 +55,7 @@ for await (const run of runs.subscribeToRunsWithTag("user:1234")) {
5555
If you've used `batchTrigger` to trigger multiple runs, you can also subscribe to changes to all the runs triggered in the batch using the `runs.subscribeToBatch` function.
5656

5757
```ts
58-
import { runs } from "@trigger.dev/sdk/v3";
58+
import { runs } from "@trigger.dev/sdk";
5959

6060
// Somewhere in your backend code
6161
for await (const run of runs.subscribeToBatch("batch-id")) {

0 commit comments

Comments
 (0)