Authentication
To create a Public Access Token, you can use theauth.createPublicToken function in your backend code:
Scopes
By default a Public Access Token has limited permissions. You can specify the scopes you need when creating a Public Access Token:Write scopes
You can also specify write scopes, which is required for triggering tasks from your frontend application:tasks is the only write scope available at the moment.
Expiration
By default, Public Access Token’s expire after 15 minutes. You can specify a different expiration time when creating a Public Access Token:- If
expirationTimeis a string, it will be treated as a time span - If
expirationTimeis a number, it will be treated as a Unix timestamp - If
expirationTimeis aDate, it will be treated as a date
Auto-generated tokens
When triggering a task from your backend, thehandle received from the trigger function now includes a publicAccessToken field. This token can be used to authenticate requests in your frontend application:
trigger function expire after 15 minutes and have a read scope for that specific run, and any tags associated with it. You can customize the expiration of the auto-generated tokens by passing a publicTokenOptions object to the trigger function:
batchTrigger function:

