Prerequisites
- A Remix project
- A Trigger.dev account with a project created
- Node.js 18 or later
Initial setup
Run the CLI init command
In the root of your Remix project, run:This creates
trigger.config.ts and a sample task at src/trigger/example.ts.Start the dev server
Run the Trigger.dev dev server (keep your Remix dev server running in a separate terminal):
Run a test
Open the Trigger.dev dashboard, navigate to your project, and use
the Test page to trigger the
hello-world task.Set your secret key locally
Add yourTRIGGER_SECRET_KEY to the .env file in the root of your Remix project. Get your DEV
secret key from the API Keys page in the dashboard:
Find your DEV API key under API Keys in the Trigger.dev dashboard.
Triggering tasks from Remix
Add environment variables
Add any environment variables your tasks require to the Trigger.dev dashboard under Environment Variables before deploying.Deploying your task
Deploying to Vercel Edge Functions
The@trigger.dev/sdk package supports the edge runtime out of the box. Use a type-only import
for the task to ensure compatibility.
Update package.json scripts
Add the
vercel-build script which copies static assets to the expected output path:package.json
Deploy to Vercel
Push your code to a Git repository, then create a new project in the Vercel dashboard and
connect it to your repo.
Add your secret key to Vercel
In your Vercel project settings, add the environment variable:Get your production secret key from the API Keys page in the Trigger.dev dashboard.
The
runtime: "edge" configuration improves cold-start times on Vercelβs Edge Network. The
type-only import (import type) ensures the task code itself is never bundled into the edge
function β only the type information is used at compile time.Additional resources
Build extensions
Add Python, browsers, FFmpeg, and other system dependencies to your tasks
Deployment guide
Learn how to deploy your tasks to production