The easiest way to get started is to use the CLI. It will add Trigger.dev to your existing project, create a /trigger folder and give you an example task.
Run this command in the root of your project to get started:
npx trigger.dev@latest initpnpm dlx trigger.dev@latest inityarn dlx trigger.dev@latest initIt will do a few things:
- 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
/triggerdirectory with an example task,/trigger/example.[ts/js].
Install the "Hello World" example task when prompted. We'll use this task to test the setup.