Setting the chapter. One moment.
Skills
Chapter 5 of 6
Set up Trigger.dev in your project. Use when adding Trigger.dev for the first time, creating trigger.config.ts, or initializing the trigger directory.
1 minute · 185 words · 17 sections
npm install @trigger.dev/sdknpx trigger initThis creates:
trigger.config.ts - project configurationtrigger/ directory - where your tasks livetrigger/example.ts - a sample taskimport { defineConfig } from "@trigger.dev/sdk";
export default defineConfig({
project: "proj_xxxxx", // From dashboard
dirs: ["./trigger"],
});// trigger/my-task.ts
import { task } from "@trigger.dev/sdk";
export const myFirstTask = task({
id: "my-first-task",
run: async (payload: { name: string }) => {
console.log(`Hello, ${payload.name}!`);
return { message: `Processed ${payload.name}` };
},
});npx trigger devFrom your app code:
import { tasks } from "@trigger.dev/sdk";
import type { myFirstTask } from "./trigger/my-task";
await tasks.trigger<typeof myFirstTask>("my-first-task", {
name: "World",
});Or from the Trigger.dev dashboard “Test” tab.
your-project/
├── trigger.config.ts # Required - project config
├── trigger/ # Required - task files
│ ├── my-task.ts
│ └── another-task.ts
├── package.json
└── ...Create .env or set in your environment:
TRIGGER_SECRET_KEY=tr_dev_xxxxx # From dashboard > API Keysdirs folderstrigger.config.ts points to correct directoriesproject in config matches dashboardTRIGGER_SECRET_KEY is setnpx trigger dev after adding new taskstask() or schemaTask() from @trigger.dev/sdkInstall this repository
npx skills add triggerdotdev/skillsSkills install per repository, not per chapter — the CLI has no documented per-skill form, so we do not print one.
main, last pushed 15 June 2026.SKILL.md, not by matching a directory convention. One layout observed: */SKILL.md.h1 and no skipped levels:/triggerdotdev/skills.md, and each chapter at its own .md URL.2 files · 4 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of chapter 5.
Documentation the agent loads on demand, rather than up front.