Automatic React hooks
These allow you to show Run and Task progress without adding extra code to your Jobs.
These are the docs for Trigger.dev v2 which will be deprecated on January 31st, 2025. You probably want the v3 docs.
The data you can receive
- Info about an event you sent, including the Runs it triggered.
- The overall status of the Run (in progress, success and fail statuses).
- Metadata like start and completed times.
- The Run output (what is returned or an error that failed the Job)
- Information about the Tasks that have completed/failed/are running.
The hooks
- useEventDetails: get the details of a specific event
- useRunDetails: get the details of a specific Run
- useEventRunDetails: get the details of a Run triggered from a specific event
All of these hooks will automatically refresh your components as the state of your Runs or events change.
useEventDetails
The useEventDetails
hook will get the details of a specific event. You can use this to show the status of a specific event.
This component will show the details of an event and the overall status of Runs that were triggered by the event:
useRunDetails
The useRunDetails
hook will get the details of a specific Run. You can use this to show the status of a specific Run.
This component will show the details of a Run and the status of each task in the Run:
useEventRunDetails
The useEventRunDetails
hook will get the details of a specific Run that was triggered by a specific event. You can use this to show the status of a specific Run.
This component will show the details of a Run and the status of each task in the Run: