env.inspector
09 / 10Conceptvercel env pullencrypted at restbranch overrides

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

Production

Applied to the deployment created by pushing to your production branch (usually main) or running vercel --prod.

Preview

Applied to deployments from any other branch. Can be scoped to all preview branches or overridden per-branch.

Development

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.

ℹSensitive environment variables
Vercel also offers a Sensitiveflag: once you save a value with it enabled, that value can no longer be read back through the dashboard or the CLI by anyone, including project owners. It's still decrypted and available to your app at build time and runtime — the restriction is purely on who can view the raw value afterward. It's only available for Preview, Production, and custom environments, not Development.
✕A real incident worth knowing about
In April 2026, a compromised third-party integration led to unauthorized access to a subset of Vercel customer environment variables that had not been marked Sensitive. Vercel asked affected customers to rotate those credentials and pointed to the Sensitive Environment Variables feature as the way to prevent a repeat. The lesson generalizes past this one incident: "encrypted at rest" protects against someone reading your database directly. It does nothing to stop a compromised integration, a leaked dashboard session, or a careless teammate from reading a plaintext value they were never meant to see. If a variable is a real secret, mark it Sensitive.

Local development

terminal
# pull this project's Development environment variables into .env
vercel env pull

# or let `vercel dev` load them into memory automatically
vercel dev

This 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.
Self-check0/3 answered
  • 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.