Use cases
Environment variables and remote configuration
Environment variables configure a process when it starts. Featurevisor global variables are typed settings that your application evaluates for each context, and they change when it loads a new datafile. This page shows which settings belong where, and how to move one across.
Choose where each setting belongs#
| Setting | Typical home |
|---|---|
| Database credentials or signing keys | Your secret management system |
| Service address needed before configuration can load | Deployment or process configuration |
| Support email that varies by country | A Featurevisor global variable |
| Payment methods selected for a customer context | A Featurevisor global variable |
| A label that changes with an experiment variation | A variable inside a Featurevisor feature |
Anyone can read a datafile sent to a browser or a phone, so keep secrets out of them. A flag does not authorize anything either, so check permissions on your server.
Move one setting at a time#
A process setting might currently look like this in Node.js:
Define the configuration value in a Featurevisor project:
description: Support email shown in checkouttype: stringAfter loading a datafile, evaluate it through an instance named f:
const context = { country: 'nl',}const supportEmail = f.getVariable('supportEmail', context) ?? process.env.SUPPORT_EMAIL ??The environment variable stays as a fallback while you move over. Once the value is in Featurevisor, overrides can give different users different addresses, which an environment variable cannot.

Moving a setting also changes who can change it. An environment variable usually needs whoever deploys the service and a restart. A global variable changes through a reviewed pull request that anyone on the team can open, and reaches running applications with the next datafile.
Understand when values change#
Changing the definition, publishing the datafile, loading it in the application and evaluating the setting are separate steps. If your application reads a value once at startup, a new datafile does not change the copy it already holds.
Evaluate where the value is needed, or evaluate again on the SDK's datafile_set event. React's hooks do this for you.
Related#
- Remote configuration, for targeting and tests
- Environments and sets, for configuration per environment
- Node.js example

