Syncing environment variables from your Vercel projects
This example demonstrates how to sync environment variables from your Vercel project to Trigger.dev.
Build configuration
To sync environment variables, you just need to add our build extension to your trigger.config.ts
file. This extension will then automatically run every time you deploy your Trigger.dev project.
You need to set the VERCEL_ACCESS_TOKEN
and VERCEL_PROJECT_ID
environment variables, or pass
in the token and project ID as arguments to the syncVercelEnvVars
build extension. If you’re
working with a team project, you’ll also need to set VERCEL_TEAM_ID
, which can be found in your
team settings. You can find / generate the VERCEL_ACCESS_TOKEN
in your Vercel
dashboard. Make sure the scope of the token covers
the project with the environment variables you want to sync.
Build extensions allow you to hook into the build system and customize the build process or the resulting bundle and container image (in the case of deploying). You can use pre-built extensions or create your own.
Running the sync operation
To sync the environment variables, all you need to do is run our deploy
command. You should see some output in the console indicating that the environment variables have been synced, and they should now be available in your Trigger.dev dashboard.
Learn more about Next.js and Trigger.dev
Walk-through guides from development to deployment
Next.js - setup guide
Learn how to setup Trigger.dev with Next.js, using either the pages or app router.
Next.js - triggering tasks using webhooks
Learn how to create a webhook handler for incoming webhooks in a Next.js app, and trigger a task from it.
Task examples
Fal.ai with Realtime in Next.js
Generate an image from a prompt using Fal.ai and Trigger.dev Realtime.
Generate a cartoon using Fal.ai in Next.js
Convert an image to a cartoon using Fal.ai.
Vercel sync environment variables
Learn how to automatically sync environment variables from your Vercel projects to Trigger.dev.
Vercel AI SDK
Learn how to use the Vercel AI SDK, which is a simple way to use AI models from different providers, including OpenAI, Anthropic, Amazon Bedrock, Groq, Perplexity etc.
Was this page helpful?