Skip to content

Commit d89e9b8

Browse files
committed
Fixed links in triggering
1 parent e210535 commit d89e9b8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

docs/realtime/react-hooks/triggering.mdx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ We provide a set of hooks that can be used to trigger tasks from your frontend a
1111
<Note>
1212
For triggering tasks from your frontend, you need to use “trigger” tokens. These can only be used
1313
once to trigger a task and are more secure than regular Public Access Tokens. To learn more about
14-
how to create and use these tokens, see our [Trigger Tokens](/realtime/auth#trigger-tokens)
15-
documentation.
14+
how to create and use these tokens, see our [Trigger
15+
Tokens](/realtime/auth#trigger-tokens-for-frontend-triggering-only) documentation.
1616
</Note>
1717

1818
## Hooks
1919

20+
We provide three hooks for triggering tasks from your frontend application:
21+
22+
- `useTaskTrigger` - Trigger a task from your frontend application.
23+
- `useRealtimeTaskTrigger` - Trigger a task from your frontend application and subscribe to the run.
24+
- `useRealtimeTaskTriggerWithStreams` - Trigger a task from your frontend application and subscribe to the run, and also receive any streams that are emitted by the task.
25+
2026
### useTaskTrigger
2127

2228
The `useTaskTrigger` hook allows you to trigger a task from your frontend application.
@@ -26,7 +32,7 @@ The `useTaskTrigger` hook allows you to trigger a task from your frontend applic
2632

2733
import { useTaskTrigger } from "@trigger.dev/react-hooks";
2834
import type { myTask } from "@/trigger/myTask";
29-
// 👆 This is the type of your task
35+
// 👆 This is the type of your task, include this to get type-safety
3036

3137
export function MyComponent({ publicAccessToken }: { publicAccessToken: string }) {
3238
// pass the type of your task here 👇
@@ -65,7 +71,7 @@ submit({ foo: "bar" }, { tags: ["tag1", "tag2"] });
6571

6672
#### Using the handle object
6773

68-
You can use the `handle` object to initiate a subsequent [realtime hook](/realtime/react-hooks/realtime#userealtimerun) to subscribe to the run.
74+
You can use the `handle` object to initiate a subsequent [realtime hook](/realtime/react-hooks/subscribe#userealtimerun) to subscribe to the run.
6975

7076
```tsx
7177
"use client"; // This is needed for Next.js App Router or other RSC frameworks

0 commit comments

Comments
 (0)