The `unleash-proxy-client` is a robust JavaScript client library tailored for integrating Unleash feature flags directly into browser-based applications. It is specifically designed to work with an Unleash Proxy or Unleash Edge instance, which acts as an intermediary to securely serve feature toggles to the frontend without exposing sensitive API keys. The current stable version is 3.7.8. The library maintains an active development pace, frequently releasing patch updates for bug fixes and minor enhancements, alongside occasional alpha/beta releases for upcoming major versions. Its core strengths include efficient context management for user and application attributes, an event-driven architecture for reacting to flag changes, and automated metrics reporting to the Unleash instance. It provides comprehensive TypeScript type definitions, significantly improving developer experience and code reliability in modern web development. This client is ideal for SPAs and server-side rendered apps where client-side feature toggle evaluation is desired.
npm install unleash-proxy-clientVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the UnleashClient, set context, listen for 'ready' and 'error' events, and check the status of a feature flag. It also shows how to react to flag updates.
Update calls to `unleash.setContextField()` and `unleash.removeContextField()` to `await unleash.setContextField()` or `unleash.setContextField().then(...)`.
Review changelogs carefully when upgrading to major versions or beta releases, especially concerning import paths and package naming.
Ensure your `url` configuration points to an Unleash Proxy or Edge instance, not directly to the Unleash API server. For local development, consider using `unleash-proxy-client` with a local proxy setup.
Ensure you are using a recent version of `unleash-proxy-client` (e.g., >=3.8.0-beta.3 where `EVENTS` export was fixed) and using named import: `import { EVENTS } from 'unleash-proxy-client'`.Ensure `new UnleashClient(...)` is called correctly and the client object is accessible. Call `unleash.start()` after configuration to initialize the client and begin fetching flags. Register event listeners *before* calling `start()` to catch early events like `READY`.
No dependency data recorded yet.