Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@launchdarkly/js-client-sdk

launchdarkly67.9kApache-2.00.8.1TypeScript support: included

LaunchDarkly SDK for JavaScript in Browsers

launchdarkly, feature flags, feature toggles, feature management, sdk

readme

LaunchDarkly JavaScript SDK for Browsers

NPM Actions Status Documentation NPM NPM

⛔️⛔️⛔️⛔️

[!CAUTION] This library is a alpha version and should not be considered ready for production use while this message is visible.

☝️☝️☝️☝️☝️☝️

Getting started

Refer to the SDK documentation for instructions on getting started with using the SDK.

Note: If you are using JavaScript in a non-browser environment, please check our other SDK packages in js-core Please note that the JavaScript SDK has two special requirements in terms of your LaunchDarkly environment. First, in terms of the credentials for your environment that appear on your Account Settings dashboard, the JavaScript SDK uses the "Client-side ID"-- not the "SDK key" or the "Mobile key". Second, for any feature flag that you will be using in JavaScript code, you must check the "Make this flag available to client-side SDKs" box on that flag's Settings page.

Verifying SDK build provenance with the SLSA framework

LaunchDarkly uses the SLSA framework (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the provenance guide.

About LaunchDarkly

  • LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
    • Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
    • Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
    • Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
    • Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan).
    • Disable parts of your application to facilitate maintenance, without taking everything offline.
  • LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read our documentation for a complete list.
  • Explore LaunchDarkly

changelog

Changelog

0.8.1 (2025-07-23)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.15.0 to 1.15.1

0.8.0 (2025-06-17)

Features

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.14.1 to 1.15.0

0.7.1 (2025-06-03)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.14.0 to 1.14.1

0.7.0 (2025-05-21)

Features

  • Add support for per-context summary events. (#859) (c9fa5c4)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.13.0 to 1.14.0

0.6.0 (2025-04-29)

Features

Bug Fixes

  • Client SDKs should use wrapper information. (#836) (1e0cf6a)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.12.6 to 1.13.0

0.5.3 (2025-04-16)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.12.5 to 1.12.6

0.5.2 (2025-04-15)

Bug Fixes

  • Handle default flush interval for browser SDK. (#822) (2c1cc7a)

0.5.1 (2025-04-08)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.12.4 to 1.12.5

0.5.0 (2025-03-26)

Features

  • Support inline context for custom and migration events (6aadf04)

Bug Fixes

  • Deprecate LDMigrationOpEvent.contextKeys in favor of LDMigrationOpEvent.context (6aadf04)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.12.3 to 1.12.4

0.4.1 (2025-02-06)

Bug Fixes

  • Ensure streaming connection is closed on SDK close. (#774) (f58e746)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.12.2 to 1.12.3

0.4.0 (2025-01-22)

Features

  • Enable source maps with inlined sources for browser SDK. (#734) (c2a87b1)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.12.1 to 1.12.2

0.3.3 (2024-11-22)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.12.0 to 1.12.1

0.3.2 (2024-11-13)

Bug Fixes

0.3.1 (2024-11-08)

Bug Fixes

  • Consolidate common exports between base package and compat package. (#674) (f692050)

0.3.0 (2024-11-04)

Features

  • Enhance basic logger destination support. (#650) (21670c4)

Bug Fixes

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.11.0 to 1.12.0

0.2.0 (2024-10-29)

Features

  • Add a module for increased backward compatibility. (#637) (44a2237)
  • Refine CJS/ESM build configuration for browser SDK. (#640) (ec4377c)
  • Vendor escapeStringRegexp to simplify builds. (48cac54)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.10.0 to 1.11.0

0.1.0 (2024-10-17)

Features

  • Add prerequisite information to server-side allFlagsState. (8c84e01)
  • Add support for client-side prerequisite events. (8c84e01)
  • Add support for inspectors. (#625) (a986478)
  • Add support for prerequisite details to evaluation detail. (8c84e01)
  • adds ping stream support (#624) (dee53af)
  • Apply private property naming standard. Mangle browser private properties. (#620) (3e6d404)

Bug Fixes

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-client-sdk-common bumped from 1.9.0 to 1.10.0

0.0.1 (2024-10-10)

Features

  • Add basic secure mode support for browser SDK. (#598) (3389983)
  • Add bootstrap support. (#600) (4e5dbee)
  • Add browser info. (#576) (a2f4398)
  • Add ESM support for common and common-client (rollup) (#604) (8cd0cdc)
  • Add support for browser contract tests. (#582) (38f081e)
  • Add support for hooks. (#605) (04d347b)
  • Add support for js-client-sdk style initialization. (53f5bb8)
  • Add support for localStorage for the browser platform. (#566) (4792391)
  • Add URLs for custom events and URL filtering. (#587) (7131e69)
  • Add visibility handling to allow proactive event flushing. (#607) (819a311)
  • adds datasource status to sdk-client (#590) (6f26204)
  • Adds support for REPORT. (#575) (916b724)
  • Browser-SDK Automatically start streaming based on event handlers. (#592) (f2e5cbf)
  • Implement browser crypto and encoding. (#574) (e763e5d)
  • Implement goals for client-side SDKs. (#585) (fd38a8f)
  • Implement support for browser requests. (#578) (887548a)
  • Refactor data source connection handling. (53f5bb8)
  • Scaffold browser client. (#579) (0848ab7)

Bug Fixes

  • Ensure browser contract tests run during top-level build. (#589) (7dfb14d)
  • Ensure client logger is always wrapped in a safe logger. (#599) (980e4da)