Supported Bun version: Deployed tasks run on Bun 1.3.3. For local development, use Bun 1.3.x
for compatibility.
Prerequisites
- Setup a project in
- Ensure TypeScript is installed
- Create a Trigger.dev account
- Create a new Trigger.dev project
Known issues
- Certain OpenTelemetry instrumentation will not work with Bun, because Bun does not support Node’s
registerhook. This means that some libraries that rely on this hook will not work with Bun. - If Bun is installed via Homebrew (e.g.
/opt/homebrew/bin/bun), you may see anENOENT: spawn /Users/<you>/.bun/bin/bunerror because the CLI expects Bun at the default install path. Workaround: create a symlink: - Bun’s WebSocket client does not handle the
101 Switching Protocolsupgrade response correctly, so connecting to a remote browser viapuppeteer.connect()/playwright.connectOverCDP()(e.g. BrowserBase, Browserless) fails silently — typically with an empty{}ErrorEvent. The remote session opens and immediately drops. Workaround: setruntime: "node"intrigger.config.tsfor tasks that connect to a remote browser.
Initial setup
Run the CLI `init` command
The easiest way to get started is to use the CLI. It will add Trigger.dev to your existing project, create a It will do a few things:
/trigger folder and give you an example task.Run this command in the root of your project to get started:- Log you into the CLI if you’re not already logged in.
- Create a
trigger.config.tsfile in the root of your project. - Ask where you’d like to create the
/triggerdirectory. - Create the
/src/triggerdirectory with an example task,/src/trigger/example.[ts/js].
Update example.ts to use Bun
Open the
/src/trigger/example.ts file and replace the contents with the following:example.ts
Run the CLI `dev` command
The CLI
dev command runs a server for your tasks. It watches for changes in your /trigger directory and communicates with the Trigger.dev platform to register your tasks, perform runs, and send data back and forth.It can also update your @trigger.dev/* packages to prevent version mismatches and failed deploys. You will always be prompted first.Perform a test run using the dashboard
The CLI 
dev command spits out various useful URLs, including a link to the dashboard. Open it, find your Example task on the Tasks page, and press the “Test” button to open its test page.Most tasks have a “payload” which you enter in the JSON editor, but our example task doesn’t need any input. You can also configure run options, pre-populate the form from recent runs, and save run templates.Press the “Run test” button.



