Skip to content

Commit 483375e

Browse files
committed
Added auth comment
1 parent 59a0916 commit 483375e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/realtime/auth.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ By default, auto-generated tokens expire after 15 minutes and have a read scope
141141

142142
See our [triggering documentation](/triggering) for detailed examples of how to trigger tasks and get auto-generated tokens.
143143

144+
<Note>
145+
**Where should I create tokens?** The standard pattern is to create tokens in your backend code (API route, server action) after triggering a task, then pass the token to your frontend. The `handle.publicAccessToken` returned by `tasks.trigger()` already does this for you. You rarely need to create tokens inside a task itself.
146+
</Note>
147+
144148
### Subscribing to runs with Public Access Tokens
145149

146150
Once you have a Public Access Token, you can use it to authenticate requests to the Realtime API in both backend and frontend applications.

0 commit comments

Comments
 (0)