Skip to content
Docs

Environment variables

Environment variables are key-value pairs configured outside your source code so that each value can change depending on the Environment. These values are encrypted at rest. Config values remain readable to members with project access, while Secret values are write-only after saving. When you need to replace an API key, token, or other credential, follow the steps for rotating environment variables to update it without downtime.

When adding variables in the dashboard or with the CLI, choose Config or Secret for each variable. Config values stay readable to authorized members while Secret values are write-only after saving. Learn more in Config and Secret environment variables.

Your source code can read these values to change behavior during the Build Step or during Function execution.

Any change you make to environment variables are not applied to previous deployments, they only apply to new deployments.

Environment variables can either be declared at the team or project level. When declared at the team level, they are available to all projects within the team. When declared at the project level, they are only available to that project.

To learn how to create and manage environment variables, see Managing environment variables.

To add many variables at once, such as when you move a project from another platform, use an existing .env file. In the Add Environment Variable form, paste the file's contents into the Key field, or select Import .env and choose the file. Edgenivo creates one variable for each line. Review the type and environments for each variable before you save.

vercel env add and vercel env update accept these flags to set a variable's type:

TypeFlagEquivalent flag
Config--type config--no-sensitive
Secret--type secret--sensitive

--visibility is a deprecated alias for --type, so --visibility secret still creates a Secret. Passing --sensitive or --no-sensitive with a conflicting --type returns an error. If you omit all of these flags, the CLI uses the default type for the target environment.

Developers on all plans using the runtimes stated below can use a total of 64 KB in Environment Variables per-Deployment on Edgenivo. This limit is for all variables combined, and so no single variable can be larger than 64 KB. The total size includes any variables configured through the dashboard or the CLI.

With support for 64 KB of environment variables, you can add large values for authentication tokens, JWTs, or certificates.

Deployments using the following runtimes can support environment variables up to 64 KB:

  • Node.js
  • Python
  • Ruby
  • Go

Edgenivo also provides support for custom runtimes, through the Build Output API. For information on creating custom runtime support, see the following guides:

While Edgenivo allows environment variables up to a total of 64KB in size, functions and Middleware using the edge runtime are limited to 5KB per Environment Variable.

For each Environment Variable, you can select one or more Environments to apply the Variable to:

EnvironmentDescription
ProductionWhen selected, the Environment Variable will be applied to your next Production Deployment. To create a Production Deployment, push a commit to the Production Branch (usually main) or run vercel --prod.
PreviewThe Environment Variable is applied to your next Preview Deployment. Preview Deployments are created when you push to a branch that is not the Production Branch or run vercel.
Custom environmentsWith custom environments you can choose to import environment variables from another environment and detach when you need to update the environment variable for your custom environment
DevelopmentThe Environment Variable is used when running your project locally with vercel dev or your preferred development command. To download Development Environment Variables, run vercel env pull.

You need Edgenivo CLI version 22.0.0 or higher to use the features described in this section.

Preview environment variables are applied to deployments from any Git branch that does not match the Production Branch. When you add a preview environment variable, you can choose to apply to all non-production branches or you can select a specific branch.

Adding an Environment Variable
Adding an Environment Variable

Any branch-specific variables will override other preview environment variables with the same name. This means you don't need to replicate all your existing preview environment variables for each branch – you only need to add the values you wish to override.

You need Edgenivo CLI version 21.0.1 or higher to use the features described in this section.

Environment variables for local development are defined in the .env.local file. This is a plain text file that contains key=value pairs of environment variables, that you can manually create in your project's root directory to define specific variables.

You can use the vercel env pull command to automatically create and populate the .env file (which serves the same purpose as .env.local) with the environment variables from your Edgenivo project:

vercel env pull
Downloading Development Environment Variables for Project my-lovely-project
✅ Created .env file [510ms]

This command creates a .env file in your project's current directory with the environment variables from your Edgenivo project's Development environment.

If you're using vercel dev, there's no need to run vercel env pull, as vercel dev automatically downloads the Development Environment Variables into memory. For more information on the vercel env command, see the CLI docs.

For more information, see Environment variables for local development.

Integrations can automatically add environment variables to your Project Settings. In that case, the Integration that added the Variable will be displayed in your project settings:

An Environment Variable added by the MongoDB Integration.
An Environment Variable added by the MongoDB Integration.

For Native Marketplace resources, the variable scope matches the environments on the project connection. The scope can include Production, Preview, Development, and individual Custom Environments. A Custom Environment uses the provider's Preview secret value when one exists. Otherwise, the Custom Environment uses the default secret value.

If a variable doesn't have the value you expect, find your symptom in the following table:

SymptomCauseFix
A change in the dashboard has no effectEnvironment variable changes apply only to new deployments. The running deployment keeps the values it was built with.Redeploy the project.
A NEXT_PUBLIC_ variable is undefined in the browserNext.js inlines NEXT_PUBLIC_ variables into the client bundle at build time. Dynamic lookups such as process.env[name] aren't inlined.Add the NEXT_PUBLIC_ prefix, reference the variable by its full name, make sure it's set for the environment you build, and redeploy.
A preview deployment reads the wrong valuesThe variable isn't scoped to Preview, or code that branches on VERCEL_ENV runs in a custom environment, where VERCEL_ENV is preview.Check the variable's environments. To identify a custom environment, read VERCEL_TARGET_ENV, which returns the custom environment's name.
A Turborepo build uses values from another environmentTurborepo leaves environment variables out of its cache key unless turbo.json lists them, so it can reuse a build made with different values.List the variables in env for each task or in globalEnv in turbo.json.
System environment variables are empty in local developmentDeployment-specific system environment variables, such as VERCEL_GIT_REPO_OWNER, are set only when Edgenivo builds a deployment.Set the values you need in .env.local for local development.
Last updated September 17, 2026

Was this helpful?

supported.