You can display the live progress of a Job Run to your users, including the status of individual tasks and the final output of the Run.

This updates live as the Job progresses, until we show the "Posted to Slack" output

Setting up your project for hooks

This guide assumes that your project is already setup and you have a Job running. If not, you should follow the quick start guide first.


Install the package

Add the package to your project:

npm install

Get your public API key

In the dashboard you should go to your Project and then the “Environments & API Keys” page.

Get your public API Key

You should copy the PUBLIC API key for the dev environment.


Setting up environment variables

Add the NEXT_PUBLIC_TRIGGER_PUBLIC_API_KEY environment variable to your project. This will be used by the TriggerProvider component to connect to the Trigger API.


Your private API key should already be in there.

NEXT_PUBLIC_ is a special prefix that exposes the environment variable to your users’ web browsers.


Add the <TriggerProvider> component

The TriggerProvider component is a React Context Provider that will make the Trigger API client available to all child components.

Generally you’ll want to add this to the root of your app, so that it’s available everywhere. However, you can add it lower in the hierarchy but it must be above any of the hooks.

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body className={inter.className}>
        <TriggerProvider publicApiKey={process.env.NEXT_PUBLIC_TRIGGER_PUBLIC_API_KEY!}>

Two ways to report Run progress

Automatic progress – without writing additional code in your Job you can get updates on the overall run status and individual tasks inside the run.

Explicit status – add code to your Job that reports the status of the things you’re doing. This gives you full flexibility for displaying progress in your UI.