Skip to content

Commit d60cfaf

Browse files
committed
Improved backend docs
1 parent f3dab2a commit d60cfaf

File tree

3 files changed

+9
-25
lines changed

3 files changed

+9
-25
lines changed

docs/realtime/backend/metadata.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,4 @@ async function monitorTypedProgress(runId: string) {
219219
}
220220
```
221221

222-
## Authentication
223-
224-
Backend metadata subscriptions support both server-side and client-side authentication. For server-side authentication, use your API key. For client-side authentication, you must generate a public access token with read access to the specific run, task, or tag. See our [authentication guide](/realtime/auth) for details.
225-
226222
<RealtimeExamplesCards />{" "}

docs/realtime/backend/overview.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ The backend API provides three main categories of functionality:
1616
- **[Metadata](/realtime/backend/metadata)** - Update and subscribe to run metadata in real-time
1717
- **[Streams](/realtime/backend/streams)** - Emit and consume real-time streaming data from your tasks
1818

19+
## Authentication
20+
21+
All backend functions support both server-side and client-side authentication:
22+
23+
- **Server-side**: Use your API key (automatically handled in tasks)
24+
- **Client-side**: Generate a Public Access Token with appropriate scopes
25+
26+
See our [authentication guide](/realtime/auth) for detailed information on creating and using tokens.
27+
1928
## Quick example
2029

2130
Subscribe to a run:
@@ -51,13 +60,4 @@ export const myTask = task({
5160
});
5261
```
5362

54-
## Authentication
55-
56-
All backend functions support both server-side and client-side authentication:
57-
58-
- **Server-side**: Use your API key (automatically handled in tasks)
59-
- **Client-side**: Generate a Public Access Token with appropriate scopes
60-
61-
See our [authentication guide](/realtime/auth) for detailed information on creating and using tokens.
62-
6363
<RealtimeExamplesCards />{" "}

docs/realtime/backend/subscribe.mdx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ These functions allow you to subscribe to run updates from your backend code. Ea
1010

1111
Subscribes to all changes to a specific run.
1212

13-
<RequestExample>
14-
1513
```ts Example
1614
import { runs } from "@trigger.dev/sdk/v3";
1715

@@ -20,8 +18,6 @@ for await (const run of runs.subscribeToRun("run_1234")) {
2018
}
2119
```
2220

23-
</RequestExample>
24-
2521
This function subscribes to all changes to a run. It returns an async iterator that yields the run object whenever the run is updated. The iterator will complete when the run is finished.
2622

2723
**Authentication**: This function supports both server-side and client-side authentication. For server-side authentication, use your API key. For client-side authentication, you must generate a public access token with read access to the specific run. See our [authentication guide](/realtime/auth) for details.
@@ -32,8 +28,6 @@ This function subscribes to all changes to a run. It returns an async iterator t
3228

3329
Subscribes to all changes to runs with a specific tag.
3430

35-
<RequestExample>
36-
3731
```ts Example
3832
import { runs } from "@trigger.dev/sdk/v3";
3933

@@ -42,8 +36,6 @@ for await (const run of runs.subscribeToRunsWithTag("user:1234")) {
4236
}
4337
```
4438

45-
</RequestExample>
46-
4739
This function subscribes to all changes to runs with a specific tag. It returns an async iterator that yields the run object whenever a run with the specified tag is updated. This iterator will never complete, so you must manually break out of the loop when you no longer want to receive updates.
4840

4941
**Authentication**: This function supports both server-side and client-side authentication. For server-side authentication, use your API key. For client-side authentication, you must generate a public access token with read access to the specific tag. See our [authentication guide](/realtime/auth) for details.
@@ -54,8 +46,6 @@ This function subscribes to all changes to runs with a specific tag. It returns
5446

5547
Subscribes to all changes for runs in a batch.
5648

57-
<RequestExample>
58-
5949
```ts Example
6050
import { runs } from "@trigger.dev/sdk/v3";
6151

@@ -64,8 +54,6 @@ for await (const run of runs.subscribeToBatch("batch_1234")) {
6454
}
6555
```
6656

67-
</RequestExample>
68-
6957
This function subscribes to all changes for runs in a batch. It returns an async iterator that yields a run object whenever a run in the batch is updated. The iterator does not complete on its own, you must manually `break` the loop when you want to stop listening for updates.
7058

7159
**Authentication**: This function supports both server-side and client-side authentication. For server-side authentication, use your API key. For client-side authentication, you must generate a public access token with read access to the specific batch. See our [authentication guide](/realtime/auth) for details.

0 commit comments

Comments
 (0)