What is Environment variable?

An environment variable is a named value, such as an API key or a port number, that is set outside the code and read by the program when it runs.

Keeping secrets in environment variables means you do not commit them to a public repository. Local files such as .env hold them during development, and a hosting service stores them in its settings.

Never put secrets in front-end code, since anyone can read it.

← All terms

↑ ↓ navigateEnter openEsc close