Glossary definitionBrowse the neighboring terms

Build Basics / Standard term

Environment variable

An environment variable is a named setting stored outside your code, such as a secret key or a chosen region, that the project reads at runtime so the value never lives inside the files you share.

An environment variable is a named setting kept outside your code that the running project reads when it starts, so the value stays out of the files you commit and share. Say your password reset feature emails a link through an outside service that requires a secret key. Instead of typing that key into a file in your repository, you store it as an environment variable named something like RESET_EMAIL_KEY. On your own machine it holds a test key, and on the deployed server it holds the live one. The code asks for RESET_EMAIL_KEY by name and gets whichever value that location supplies, so the same code runs everywhere while each environment supplies its own settings.

Builder example

Environment variables are how you keep secrets and per-place settings out of shared code. If your support bot calls a paid AI service, the access key belongs in an environment variable, so it does not end up in version control where anyone with the repository could read it. They also let one codebase behave differently per location: a test database on your laptop, the live one in production. When you tell your AI assistant to wire up a service, ask it to read the key from an environment variable rather than pasting it into a file.

Common confusion: An environment variable holds a value; it does not encrypt or hide it on the server itself. Anyone with access to that running environment can read the value, so it keeps secrets out of shared code without making them secret from the host. What it protects against is the key leaking through your repository.