Skip to content

Commit c603b7c

Browse files
committed
Triggering docs and adding options to all trigger hooks
1 parent cd7a451 commit c603b7c

File tree

9 files changed

+995
-831
lines changed

9 files changed

+995
-831
lines changed

.changeset/nine-vans-perform.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/react-hooks": patch
3+
---
4+
5+
Add trigger options to all trigger hooks

docs/frontend/overview.mdx

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -89,35 +89,6 @@ const publicToken = await auth.createPublicToken({
8989
});
9090
```
9191

92-
### Write scopes
93-
94-
You can also specify write scopes, which is required for triggering tasks from your frontend application:
95-
96-
```ts
97-
const publicToken = await auth.createPublicToken({
98-
scopes: {
99-
write: {
100-
tasks: ["my-task-1", "my-task-2"],
101-
},
102-
},
103-
});
104-
```
105-
106-
This will allow the token to trigger the specified tasks. `tasks` is the only write scope available at the moment.
107-
108-
We **strongly** recommend creating short-lived tokens for write scopes, as they can be used to trigger tasks from your frontend application:
109-
110-
```ts
111-
const publicToken = await auth.createPublicToken({
112-
scopes: {
113-
write: {
114-
tasks: ["my-task-1"], // ✅ this token can trigger this task
115-
},
116-
},
117-
expirationTime: "1m", // ✅ this token will expire after 1 minute
118-
});
119-
```
120-
12192
### Expiration
12293

12394
By default, Public Access Token's expire after 15 minutes. You can specify a different expiration time when creating a Public Access Token:

0 commit comments

Comments
 (0)