@trigger.dev/react-hooks gives your React components live access to background tasks. Subscribe to run progress, stream AI output as it generates, or trigger tasks directly from the browser.
Installation
Install the@trigger.dev/react-hooks package in your project:
Authentication
All hooks require authentication with a Public Access Token. Pass the token via theaccessToken option:
Available hooks
| Hook category | What it does | Guide |
|---|---|---|
| Trigger hooks | Trigger tasks from the browser | Triggering |
| Run updates | Subscribe to run status, metadata, and tags | Run updates |
| Streaming | Consume AI output, file chunks, or any continuous data | Streaming |
| SWR hooks | One-time fetch with caching (not recommended for most cases) | SWR |
SWR vs Realtime hooks
We offer two “styles” of hooks: SWR and Realtime. SWR hooks use the swr library to fetch data once and cache it. Realtime hooks use Trigger.dev Realtime to subscribe to updates as they happen.It can be a little confusing which one to use because swr can also be
configured to poll for updates. But because of rate-limits and the way the Trigger.dev API works,
we recommend using the Realtime hooks for most use cases.

