This quick start guide will get you up and running with Trigger.dev.


Create a Trigger.dev account

You can either:


Create your first project

Once you've created an account, follow the steps in the app to:

  1. Complete your account details.
  2. Create your first Organization and Project.

Getting an API key

  1. Go to the "Environments & API Keys" page in your project. Go to the Environments & API Keys page

  2. Copy the DEV SERVER API key. API Keys


Run the CLI `init` command

The easiest way to get started it to use the CLI. It will add Trigger.dev to your existing project, setup a route and give you an example file.

In a terminal window run:

npx @trigger.dev/cli@latest init

It will ask you a couple of questions

  1. Are you using the Trigger.dev Cloud or self-hosting?
  2. Enter your development API key. Enter the key you copied earlier.

Run your site

Make sure your site is running locally, we will connect to it to register your Jobs.

You must leave this running for the rest of the steps.

npm run dev

Run the CLI `dev` command

The CLI dev command allows the Trigger.dev service to send messages to your site. This is required for registering Jobs, triggering them and running tasks. To achieve this it creates a tunnel (using ngrok) so Trigger.dev can send messages to your machine.

You should leave the dev command running when you're developing.

In a new terminal window or tab run:

npx @trigger.dev/cli@latest dev

You can optionally pass the port if you're not running on the default port by adding --port 3001 to the end.


Your first job

The CLI init command created a simple Job for you. There will be a new file app/jobs/example.server.(ts/js).

In there is this Job:

// Your first job
// This Job will be triggered by an event, log a joke to the console, and then wait 5 seconds before logging the punchline
  // This is the unique identifier for your Job, it must be unique across all Jobs in your project
  id: "example-job",
  name: "Example Job: a joke with a delay",
  version: "0.0.1",
  // This is triggered by an event using eventTrigger. You can also trigger Jobs with webhooks, on schedules, and more: https://trigger.dev/docs/documentation/concepts/triggers/introduction
  trigger: eventTrigger({
    name: "example.event",
  run: async (payload, io, ctx) => {
    // This logs a message to the console
    await io.logger.info("🧪 Example Job: a joke with a delay");
    await io.logger.info("How do you comfort a JavaScript bug?");
    // This waits for 5 seconds, the second parameter is the number of seconds to wait, you can add delays of up to a year
    await io.wait("Wait 5 seconds for the punchline...", 5);
    await io.logger.info("You console it! 🤦");
    await io.logger.info(
      "✨ Congratulations, You just ran your first successful Trigger.dev Job! ✨"
    // To learn how to write much more complex (and probably funnier) Jobs, check out our docs: https://trigger.dev/docs/documentation/guides/create-a-job

If you navigate to your Trigger.dev project you will see this Job in the “Jobs” section:

Your first Job


Triggering the Job

There are two way to trigger this Job.

  1. Use the "Test" functionality in the dashboard.
  2. Use the Trigger.dev API (either via our SDK or a web request)

"Testing" from the dashboard

Click into the Job and then open the "Test" tab. You should see this page:

Test Job

This Job doesn't have a payload schema (meaning it takes an empty object), so you can simple click the "Run test" button.

Congratulations, you should get redirected so you can see your first Run!


'TriggerProvider' not found

When running the Remix app, you may see an error like this:

import { TriggerProvider } from "@trigger.dev/react";
SyntaxError: Named export 'TriggerProvider' not found. The requested module '@trigger.dev/react' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@trigger.dev/react';
const { TriggerProvider } = pkg;

To fix this, edit your remix.config.js file and add the @trigger.dev/react package to your list of serverDependenciesToBundle:

export default {
  // ... other config
  serverDependenciesToBundle: ["@trigger.dev/react"],

[ERROR] Node builtin "buffer"

When running the Remix app, you may see an error like this:

✘ [ERROR] Node builtin "buffer" (imported by "node_modules/@trigger.dev/core/dist/index.js") must be polyfilled for the browser.
You can enable this polyfill in your Remix config, e.g. `browserNodeBuiltinsPolyfill: { modules: { buffer: true } }`
[plugin browser-node-builtins-polyfill-plugin]

To fix this, edit your remix.config.js file and add the browserNodeBuiltinsPolyfill config:

export default {
  browserNodeBuiltinsPolyfill: {
    modules: {
      buffer: "empty",

What's next?