Skip to content

Commit f57581e

Browse files
committed
Restructured overview
1 parent fd37ce7 commit f57581e

File tree

2 files changed

+18
-51
lines changed

2 files changed

+18
-51
lines changed

docs/realtime/backend/overview.mdx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,4 @@ for await (const run of runs.subscribeToRun(handle.id)) {
4141
}
4242
```
4343

44-
Stream data from a task:
45-
46-
```ts
47-
import { task, metadata } from "@trigger.dev/sdk/v3";
48-
49-
export const myTask = task({
50-
id: "my-task",
51-
run: async (payload) => {
52-
// Stream real-time data
53-
const stream = await metadata.stream("openai", openaiCompletion);
54-
55-
// Process the stream
56-
for await (const chunk of stream) {
57-
console.log("Streaming chunk:", chunk);
58-
}
59-
},
60-
});
61-
```
62-
6344
<RealtimeExamplesCards />{" "}

docs/realtime/overview.mdx

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Realtime overview
33
sidebarTitle: Overview
4-
description: Using the Trigger.dev Realtime API to subscribe to runs in real-time.
4+
description: Using the Trigger.dev Realtime API to trigger and subscribe to runs in real-time.
55
---
66

77
import RealtimeExamplesCards from "/snippets/realtime-examples-cards.mdx";
@@ -10,51 +10,37 @@ Trigger.dev Realtime allows you to trigger, subscribe to, and get real-time upda
1010

1111
## Authentication
1212

13-
All Realtime subscriptions require authentication so you can securely trigger and subscribe to runs. See our [authentication guide](/realtime/auth) for details on:
14-
15-
- Creating Public Access Tokens to subscribe to runs
16-
- Creating Trigger Tokens to trigger tasks from your frontend
17-
- Scoping tokens to specific runs, tasks, tags, or batches
18-
- Auto-generated tokens from `tasks.trigger()`
13+
All Realtime subscriptions require authentication so you can securely trigger and subscribe to runs. See our [authentication guide](/realtime/auth) for more details.
1914

2015
## How run subscriptions work
2116

22-
You can subscribe to real-time updates for:
23-
24-
- **Specific runs** - Monitor individual run progress
25-
- **Runs with specific tags** - Track runs by category or user
26-
- **Task runs** - All runs for specific tasks
27-
- **Batch runs** - All runs in a batch
28-
29-
When you subscribe to runs, you automatically receive the complete [run object](/realtime/run-object) containing status, timestamps, metadata, tags, and more whenever:
17+
You can subscribe to real-time updates for different scopes of runs:
3018

31-
- Run status changes (queued → executing → completed, etc.)
32-
- [Run metadata](/runs/metadata) is updated
33-
- [Run tags](/tags) are added or removed
34-
- [Stream data](/realtime/backend#streams) is emitted
19+
- **Specific runs** - Monitor individual run progress by run ID
20+
- **Runs with specific tags** - Track all runs that have certain [tags](/tags) (e.g., all runs tagged with `user:123`)
21+
- **Batch runs** - All runs within a specific batch
22+
- **Trigger + subscribe combos** - Trigger a task and immediately subscribe to its run (frontend only)
3523

36-
Your tasks can also send additional custom data:
24+
Once subscribed, you'll receive the complete [run object](/realtime/run-object) with automatic real-time updates whenever the run changes, including:
3725

38-
- **Metadata updates** - Update custom metadata on runs that gets streamed to subscribers ([backend](/realtime/backend/metadata) | [React hooks](/realtime/react-hooks/realtime#using-metadata))
39-
- **Stream function** - Stream data chunks in real-time, perfect for AI/LLM streaming ([backend](/realtime/backend/streams) | [React hooks](/realtime/react-hooks/streams))
26+
- **Status changes** - queued → executing → completed, etc.
27+
- **Metadata updates** - Custom progress tracking, status updates, user data, etc. ([backend](/realtime/backend/metadata) | [React hooks](/realtime/react-hooks/realtime#using-metadata))
28+
- **Tag changes** - When [tags](/tags) are added or removed from the run
29+
- **Stream data** - Real-time data chunks from your tasks, perfect for AI/LLM streaming ([backend](/realtime/backend/streams) | [React hooks](/realtime/react-hooks/streams))
4030

41-
## Implementation approaches
42-
43-
### Backend implementation
44-
45-
Use our server-side SDK to subscribe to runs from your backend code, other tasks, or serverless functions. Perfect for triggering workflows, sending notifications, or updating databases based on run status changes.
46-
47-
**[See Backend functions guide](/realtime/backend)**
31+
## Realtime approaches
4832

4933
### Frontend implementation
5034

5135
Use our React hooks to build real-time UIs that update as runs execute. Ideal for progress bars, status indicators, and live dashboards.
5236

53-
**[See React hooks guide](/realtime/react-hooks)**
37+
**[See our React hooks guide](/realtime/react-hooks)**
5438

55-
## Technical details
39+
### Backend implementation
40+
41+
Use our server-side SDK to subscribe to runs from your backend code, other tasks, or serverless functions. Perfect for triggering workflows, sending notifications, or updating databases based on run status changes.
5642

57-
Learn more about the underlying technology and run object structure in our [How it Works](/realtime/how-it-works) guide.
43+
**[See our Backend guide](/realtime/backend)**
5844

5945
## Realtime demo
6046

0 commit comments

Comments
 (0)