Skip to content

Commit 6b3d145

Browse files
docs: add note for environment variables on Vercel deployment (#59237)
Co-authored-by: Delba de Oliveira <[email protected]>
1 parent 002af4e commit 6b3d145

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Next.js allows you to set defaults in `.env` (all environments), `.env.developme
173173
174174
## Environment Variables on Vercel
175175

176-
When deploying your Next.js application to [Vercel](https://vercel.com), Environment Variables can be configured [in the Project Settings](https://vercel.com/docs/concepts/projects/environment-variables?utm_source=next-site&utm_medium=docs&utm_campaign=next-website).
176+
When deploying your Next.js application to [Vercel](https://vercel.com), Environment Variables can be configured [in the Project Settings](https://vercel.com/docs/projects/environment-variables?utm_medium=docs&utm_source=next-site&utm_campaign=next-website).
177177

178178
All types of Environment Variables should be configured there. Even Environment Variables used in Development – which can be [downloaded onto your local device](https://vercel.com/docs/concepts/projects/environment-variables#development-environment-variables?utm_source=next-site&utm_medium=docs&utm_campaign=next-website) afterwards.
179179

@@ -183,6 +183,8 @@ If you've configured [Development Environment Variables](https://vercel.com/docs
183183
vercel env pull .env.local
184184
```
185185

186+
> **Good to know**: When deploying your Next.js application to [Vercel](https://vercel.com), your environment variables in `.env*` files will not be made available to Edge Runtime, unless their name are prefixed with `NEXT_PUBLIC_`. We strongly recommend managing your environment variables in [Project Settings](https://vercel.com/docs/projects/environment-variables?utm_medium=docs&utm_source=next-site&utm_campaign=next-website) instead, from where all environment variables are available.
187+
186188
## Test Environment Variables
187189

188190
Apart from `development` and `production` environments, there is a 3rd option available: `test`. In the same way you can set defaults for development or production environments, you can do the same with a `.env.test` file for the `testing` environment (though this one is not as common as the previous two). Next.js will not load environment variables from `.env.development` or `.env.production` in the `testing` environment.

0 commit comments

Comments
 (0)