Use cases
Environment variables and remote configuration
Environment variables configure a process when it starts. Featurevisor global variables provide typed settings that your application can evaluate against context and update by loading a new datafile. Both have a useful role.
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 |
Datafiles supplied to browsers and mobile clients are inspectable. Keep secrets out of them. A feature flag is also not an authorization boundary.
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 address shown to userstype: stringAfter loading a datafile, evaluate it through an instance named f:
const supportEmail = f.getVariable('supportEmail', { country: 'nl' }) ?? process.env.SUPPORT_EMAIL ??This keeps a process fallback during the transition. Add overrides once you need different addresses for different contexts.
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 evaluates a value only once at startup, updating the SDK later does not rewrite that application's local variable automatically.
Evaluate where the value is needed, or subscribe to updates using your framework integration, such as React or Vue.
For independent environment configurations, see environments and sets. For a complete example with targeting and tests, follow remote configuration.
Use the Node.js consumer example as a starting point for your service.

