Environment variable
A named setting stored outside the code, like an API key, that the app reads when it runs.
What it is
An environment variable is a name and a value (STRIPE_KEY=sk_test_...) set on the machine or platform rather than written into the code. The app reads it when it starts.
They exist for two reasons. Secrets like API keys stay out of the code, so they don't leak when code is shared. And the same code can behave differently per environment: test keys in development, live keys in production.
Locally they often live in a .env file, which should never be committed to version control. On hosting platforms they're set in a dashboard, usually under "Secrets" or "Environment."
How to ask for it
“Here's my Stripe key, put it in the code.”
“Store my Stripe secret key as an environment variable called STRIPE_SECRET_KEY, with the test key in development and the live key in production. Never hardcode it or log it.”
Asking for an environment variable keeps the secret out of your code and lets each environment use the right key.
You've seen this in
- PA .env file in a project folder
- V"Environment variables" settings in Vercel or Netlify
- F"Missing STRIPE_SECRET_KEY" errors on first run