Using the Trigger.dev SDK from your frontend application.
auth.createPublicToken
function in your backend code:
auth.configure
function or the auth.withAuth
function:
expirationTime
is a string, it will be treated as a time spanexpirationTime
is a number, it will be treated as a Unix timestampexpirationTime
is a Date
, it will be treated as a datehandle
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:
runs.retrieve
function allows you to retrieve a run by its ID.
runs.retrieve
function in the runs.retrieve doc.
runs.subscribeToRun
function allows you to subscribe to a run by its ID, and receive updates in real-time when the run changes.
runs.subscribeToRunsWithTag
function allows you to subscribe to runs with a specific tag, and receive updates in real-time when the runs change.