Environment Variables Explained: Settings Outside Your Website Code
How can the same code use different service settings? Environment variables provide named configuration values to a process.
1:47 · No narration: the video shows each step as text on screen, and every step is written out below, with buttons that jump the video to it.
Prefer YouTube? Watch this video on our YouTube channel (opens in a new tab).
The six points in the video
This is a silent video. The headings, explanations and labels below reproduce the information on screen.
-
Step 1: A variable has a name and value
The application reads the named setting when it needs it.
On-screen labels: Setting name; Configured value; Application use.
-
Step 2: Environments can differ
A test environment can use different values from production.
On-screen labels: Local development; Preview settings; Production settings.
-
Step 3: Check when the value is read
A value may be used during a build or while the application runs.
On-screen labels: Build-time use; Runtime use; Framework behaviour.
-
Step 4: Some values are sensitive
Tokens and credentials need protected storage and restricted access.
On-screen labels: Private credentials; Protected storage; Limited access.
-
Step 5: Browser values are public
A value included in downloaded website code can be inspected.
On-screen labels: Browser bundle; Visible configuration; No private secrets.
-
Step 6: Check how changes take effect
Follow the platform process and test the updated deployment.
On-screen labels: Correct environment; Required rebuild; Verified behaviour.
A practical check for your business
Keep a documented inventory of required configuration names and who maintains their values. Review which values may reach the browser and use the platform's supported protection for sensitive settings.
Sources and further detail
Common questions
How can the same code use different service settings?
Environment variables provide named configuration values to a process. Know which settings are public and which must stay private.
Go further
More video tips
All 205 videos →
API Keys Explained: Scope, Restrictions and Safer Website Integration
A service credential, explained.
Software Dependencies Explained: The Other Code Your Website Uses
Dependencies, explained.