Push environment variables from .env.production to your Vercel project using the Vercel REST API. Variables are stored as encrypted secrets.
npm i -g vercelnpm run env
npm run env:prod
npm run env:prev
./_scripts/push-env-to-vercel.sh "preview,production"
.env.production.vercel/project.json for future useOn first run, the script will:
vercel link to connect to your projectThe script reads from .env.production:
# Comments are ignoredNEXT_PUBLIC_SITE_URL=https://yourdomain.comMAILGUN_API_KEY=your-api-key-here
Install the Vercel CLI globally:
npm i -g vercel
Your Vercel token is invalid or lacks permissions. Generate a new token at vercel.com/account/tokens.
Create a .env.production file in your project root. You can copy from .env.production.sample:
cp .env.production.sample .env.production
Then fill in your real values.