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

Package detail

@launchdarkly/js-sdk-common

launchdarkly4mApache-2.02.18.0TypeScript support: included

LaunchDarkly SDK for JavaScript - common code

launchdarkly, analytics, client

readme

LaunchDarkly SDK JavaScript Common Code

NPM Actions Status Documentation

This project contains Typescript classes and interfaces that are applicable to client-side and server-side JavaScript SDKs.

Contributing

See Contributing.

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. Check out our documentation for a complete list.
  • Explore LaunchDarkly

changelog

Changelog

All notable changes to @launchdarkly/js-sdk-common will be documented in this file. This project adheres to Semantic Versioning.

2.18.0 (2025-05-21)

Features

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

2.17.0 (2025-04-29)

Features

2.16.0 (2025-04-16)

Features

2.15.0 (2025-04-08)

Features

  • Option to use gzip to compress event (#814) (4e91431)

2.14.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)

2.13.0 (2025-01-22)

Features

  • Adds StreamingProcessor for FDv2 to sdk-server package. (#707) (7f5c275)

Bug Fixes

  • Remove outdated reference to geolocation. (#719) (0eeb3b6)

2.12.0 (2024-11-04)

Features

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

2.11.0 (2024-10-17)

Features

  • Apply private property naming standard. Mangle browser private properties. (#620) (3e6d404)

Bug Fixes

  • Update sdk-client rollup configuration to match common (#630) (e061811)

2.10.0 (2024-10-09)

Features

  • Add ESM support for common and common-client (rollup) (#604) (8cd0cdc)
  • Add visibility handling to allow proactive event flushing. (#607) (819a311)
  • adds datasource status to sdk-client (#590) (6f26204)

2.9.0 (2024-09-26)

Features

  • Add platform support for async hashing. (#573) (9248035)
  • Add support for conditional event source capabilities. (#577) (fe82500)
  • Add URLs for custom events and URL filtering. (#587) (7131e69)
  • Adds support for REPORT. (#575) (916b724)
  • Allow using custom user-agent name. (#580) (ed5a206)
  • Implement goals for client-side SDKs. (#585) (fd38a8f)

Bug Fixes

  • Multi-kind context containing only 1 kind conveted incorrectly. (#594) (b6ff2a6)

2.8.0 (2024-09-03)

Features

2.7.0 (2024-08-28)

Features

2.6.0 (2024-08-12)

Features

  • refactors the implementation of context caching. You can now s… (#531) (8ab2ee4)

2.5.0 (2024-06-04)

Features

  • Add support for a cancel-able timeout. (#476) (24ecf1d)

2.4.2 (2024-04-26)

Bug Fixes

  • Handle missing message with valid string. (#450) (6ff8982)
  • Produce a warning when track is called with a non-numeric metric value. (#449) (6799742)

2.4.1 (2024-04-09)

Bug Fixes

2.4.0 (2024-04-09)

Features

Bug Fixes

  • Identify incorrectly rejected in client-sdk (#426) (a019dd6)

2.3.1 (2024-03-25)

Bug Fixes

2.3.0 (2024-03-15)

Features

  • Always inline contexts for feature events (#351) (961d21b)
  • Redact anonymous attributes within feature events (#352) (8f7ad7e)

2.2.0 (2024-02-06)

Features

  • Implement common client side support for auto environment attributes. (#356) (8d80259)
  • Implement common support for auto environment attributes. (#355) (9f562e5)
  • React-native support for auto-env attributes. Only affects react-native package. (deea99c)
  • Update eslint jest configuration and versions. (deea99c)

Bug Fixes

  • Add LDOptions.application name and versionName. (#358) (cd75210)
  • Add RN SDK offline support through ConnectionMode. (#361) (d97ce82)
  • Implement anonymous context processing (#350) (308100d)
  • RN streamer connection in background and foreground. (#360) (c69b768)

2.1.1 (2024-01-16)

Bug Fixes

  • remove type modifiers on imports for better TS compatibility (#346) (3506349)
  • Treat 413 HTTP status as recoverable for events. (#348) (4a6d4c3)

2.1.0 (2023-11-14)

Features

  • edge sdks should send events to bulk/environment endpoint (#256) (f45910f)

2.0.0 (2023-10-16)

⚠ BREAKING CHANGES

  • Implement Migrations. Refactor for client SDKs. (#293)

Features

  • Implement Migrations. Refactor for client SDKs. (#293) (c66aa6e)

1.1.0 (2023-08-14)

Features

  • Allow specifying the user agent per-sdk implementation. (#226) (e57716f)

1.0.3 (2023-08-10)

Bug Fixes

  • Switch to es2017 target to ensure native async/await. (a83e4e6)

1.0.2 (2023-06-13)

Bug Fixes

  • Correctly handle excluded big segments. (#160) (e9cb45a)

1.0.1 (2023-04-27)

Bug Fixes

  • add licence and fix missing package.json fields. (c586398)
  • Ensure top level commands work correctly (#105) (762571f)
  • remove beta text from cloudflare sdk readme. (c586398)

1.0.0 (2023-04-26)

Features

0.3.0 (2023-04-19)

Features

0.2.0 (2023-03-16)

Features

  • Update packaging to include only needed files. (06b2f28)

0.1.0 (2023-03-15)

Initial prerelease version.