Node.js SDK
TypeScript-first client for evaluating feature flags in Node.js applications.
Installation
bash
npm install @featuresignals/nodeRequirements: Node.js 22+, ESM
Quick Start
typescript
import { FeatureSignalsClient } from '@featuresignals/node';
const client = new FeatureSignalsClient('fs_srv_your_api_key', {
envKey: 'production',
baseURL: 'https://api.featuresignals.com',
});
await client.waitForReady();
const enabled = client.boolVariation('new-feature', { key: 'user-123' }, false);
console.log('Feature enabled:', enabled);
// When shutting down
client.close();Configuration Options
| Option | Type | Default |
|---|---|---|
envKey | string | (required) |
baseURL | string | https://api.featuresignals.com |
pollingIntervalMs | number | 30000 |
streaming | boolean | false |
timeoutMs | number | 10000 |
Events
typescript
client.on('ready', () => console.log('Flags loaded'));
client.on('error', (err) => console.error('Fetch failed:', err));
client.on('update', (flags) => console.log('Updated:', Object.keys(flags).length));