Logo

Usage Examples

Vercel

Vercel projects read environment variables both at build time and runtime. EnvVault generates a JSON file you can import into the Vercel dashboard, or you can pull values directly into the build step.

Bulk Import via Dashboard

envv serverless --platform=vercel -e production -o vercel-env.json
# Open Vercel dashboard → Project → Settings → Environment Variables → Import → upload vercel-env.json

Pull at Build Time

Use the Vercel build command to fetch the latest values just before next build:

# In Vercel project settings → Build & Development → Build Command:
envv generate --type=env -e production > .env.production && next build

Set ENVVAULT_TOKEN on Vercel as a build-time environment variable. The CLI is preinstalled via npm i -g @envvault/cli in postinstall, or you can use the standalone binary.

Vercel CLI

# Push every key from EnvVault into Vercel
envv generate --type=env -e production | while IFS='=' read -r key value; do
  echo "$value" | vercel env add "$key" production --force
done

Per-Branch Previews

For preview environments, use a per-branch EnvVault environment (e.g. preview or pr-123) and pick it via the Vercel build hook.