Vercel environments
Everything on this page is a deployment-platform concern, layered on top of everything Next.js itself does. Vercel decides which variables exist in which deployment, who inside your team can see the value, and how large a single variable is allowed to be.
Three (or more) environments, three sets of values
Applied to the deployment created by pushing to your production branch (usually main) or running vercel --prod.
Applied to deployments from any other branch. Can be scoped to all preview branches or overridden per-branch.
Used by vercel dev, or pulled into a local .env file with vercel env pull for next dev.
A branch-specific Preview override replaces the general Preview value only for that branch — you don't need to duplicate every variable per branch, only the ones that differ.
"Encrypted at rest" is not the same as "hidden from your team"
By default, environment variables on Vercel are encrypted at rest but remain visible — value and all — to anyone with access to the project in the dashboard. For a genuine secret, that's often more exposure than you want, especially on a larger team.
Local development
# pull this project's Development environment variables into .env
vercel env pull
# or let `vercel dev` load them into memory automatically
vercel devThis project doesn't assume you're using Vercel CLI — .env.local.example works the same way with plain next dev. Both approaches land in the same place: a local .env* file that never gets committed.
Size limits, recapped
- • 64KB total per deployment, across every variable combined, for standard runtimes.
- • No single variable may itself exceed that 64KB total.
- • Edge Functions and Edge middleware are limited to 5KB per individual variable — see Problem 04.
By default, any teammate with access to a Vercel project can view an environment variable’s raw value in the dashboard.
A Sensitive environment variable is unavailable to your app at runtime.
Preview environment variables always apply identically to every non-production branch.