Skip to content

Latest commit

 

History

History

README.md

Next.js + Trigger.dev Hello World

Deploy with Vercel

A minimal Next.js app that triggers a background task from an API route. Click a button, fire a task, watch it run on Trigger.dev.

The whole thing is ~20 lines of task code in trigger/hello-world.ts.

How it works

  1. The frontend calls POST /api/hello
  2. The API route triggers the hello-world task using the Trigger.dev SDK
  3. The task runs on Trigger.dev's infrastructure (with retries, logging, the works)

Local dev

cp .env.example .env.local
# Add your TRIGGER_SECRET_KEY from cloud.trigger.dev
pnpm install
pnpm dev          # Next.js on :3000
npx trigger dev   # Trigger.dev dev server

Deploy to Vercel

Click the deploy button above, then install the Trigger.dev Vercel integration to automatically sync your environment variables.

Learn more about Trigger.dev