The `unleash-client` package provides a server-side SDK for Node.js applications to integrate with the Unleash feature management platform. It enables dynamic evaluation of feature flags, allowing developers to control feature rollouts, perform A/B testing, and manage configurations without redeploying code. The current stable version is 6.11.1, with frequent patch and minor releases addressing bug fixes, performance improvements, and new constraint types (like semver and CIDR). This client is designed for high performance and low overhead, maintaining an in-memory repository of feature toggles that are polled from the Unleash server at regular intervals. It supports both Unleash Enterprise and Open Source instances and is suitable for applications requiring robust and scalable feature flag capabilities. Key differentiators include its focus on server-side evaluation, asynchronous initialization with event-driven readiness signals, and support for various constraint types.
npm install unleash-clientVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing the Unleash client, listening for readiness events, and evaluating a feature flag.
Upgrade your Node.js runtime environment to version 20 or higher. Consider using a Node.js version manager like `nvm` or `volta`.
Listen for the `'ready'` or `'synchronized'` events on the Unleash client instance before evaluating feature flags. Alternatively, use a bootstrapped configuration for initial values.
Ensure `initialize()` is called only once in your application's lifecycle, typically at startup. If you need multiple, distinct instances, construct `UnleashClient` directly but manage them as singletons within their respective contexts.
Upgrade to `unleash-client@6.10.1` or newer to ensure the patched `minimatch` version is used. Regularly check for dependency updates.
Review your network configuration and any custom fetch options if upgrading from `unleash-client < 6.9.4`. Test thoroughly for unexpected network behavior.
Ensure `unleash-client` is installed (`npm install unleash-client`). If using CommonJS, change `import { initialize } from 'unleash-client';` to `const { initialize } = require('unleash-client');`.Verify that `unleash` is a valid `UnleashClient` instance. Ensure it's correctly assigned from `initialize()` and accessible in the scope where `isEnabled` is called.
Ensure the `url` parameter in `initialize({ url: '...' })` is a complete and valid URL, e.g., 'https://unleash.example.com/api'.Check the client's logs for connection errors. Ensure `appName` and `instanceId` match the client registration in Unleash. Wait for the `'synchronized'` event before relying on `isEnabled()` outcomes. Verify the provided API token has client access permissions.
No dependency data recorded yet.