Featurevisor

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

SettingTypical home
Database credentials or signing keysYour secret management system
Service address needed before configuration can loadDeployment or process configuration
Support email that varies by countryA Featurevisor global variable
Payment methods selected for a customer contextA Featurevisor global variable
A label that changes with an experiment variationA 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:

const supportEmail = process.env.SUPPORT_EMAIL || '[email protected]'

Define the configuration value in a Featurevisor project:

variables/supportEmail.yml
description: Support address shown to users
type: string
defaultValue: [email protected]

After 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.

Previous
Configuration rollback