You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 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.
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:
Copy file name to clipboardExpand all lines: docs/realtime/how-it-works.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ The run object returned by Realtime subscriptions is optimized for streaming upd
25
25
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.
26
26
27
27
```ts
28
-
import { runs, tasks } from"@trigger.dev/sdk/v3";
28
+
import { runs, tasks } from"@trigger.dev/sdk";
29
29
30
30
// Somewhere in your backend code
31
31
asyncfunction myBackend() {
@@ -43,7 +43,7 @@ Every time the run changes, the async iterator will yield the updated run. You c
43
43
Alternatively, you can subscribe to changes to any run that includes a specific tag (or tags) using the `runs.subscribeToRunsWithTag` function.
44
44
45
45
```ts
46
-
import { runs } from"@trigger.dev/sdk/v3";
46
+
import { runs } from"@trigger.dev/sdk";
47
47
48
48
// Somewhere in your backend code
49
49
forawait (const run ofruns.subscribeToRunsWithTag("user:1234")) {
@@ -55,7 +55,7 @@ for await (const run of runs.subscribeToRunsWithTag("user:1234")) {
55
55
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.
56
56
57
57
```ts
58
-
import { runs } from"@trigger.dev/sdk/v3";
58
+
import { runs } from"@trigger.dev/sdk";
59
59
60
60
// Somewhere in your backend code
61
61
forawait (const run ofruns.subscribeToBatch("batch-id")) {
0 commit comments