Skip to main content

JavaScript & Node

You can find the Node SDK on npm. Implementation details can be found on the libraries GitHub.

Example

const manager = new FeatureSwitchManager("some-api-key", "stage");

const result = await manager.getSwitchValue("devToolsEnabled");

if(result.value) {
// switch is on
} else {
// switch is off
}

const switches = await manager.getSwitches();

const found = switches.find(fs => fs.key === 'devToolsEnabled');

if(found && found.value) {
// switch is on
}