How do I migrate away from `vercel.json` env and build.env?

This article will help you migrate your vercel.json environment variables (legacy method) to the Environment Variables UI.

Migrate Your Environment Variables

You may have configured the env and build.env legacy properties in a vercel.json file:

{
"env": {
"MY_KEY": "this is the value",
"SECRET": "@my-secret-name"
},
"build": {
"env": {
"MY_KEY": "this is the value",
"SECRET": "@my-secret-name"
}
}
}
A configured vercel.json file with environment variables.

We no longer recommend you use this legacy method for environment variables. Instead, we recommend you migrate your environment variables to the Environment Variables UI. Here is how to add the same envrionment variables setup to our Environment Variables UI using the example above:

Adding a Plaintext Environment Variable.
Adding a Plaintext Environment Variable.
Adding a Secret Environment Variable.
Adding a Secret Environment Variable.

Migrating to the Environment Variables UI will help you avoid errors when implementing your environment variables.

Redeploy

Once you have successfully moved your environment variables to the Environment Variables UI, make sure to redeploy your Vercel Project to reflect these new changes.

Couldn't find the guide you need?