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

Package detail

@launchdarkly/node-server-sdk

launchdarkly3.8mApache-2.09.10.0TypeScript support: included

LaunchDarkly Server-Side SDK for Node.js

launchdarkly, analytics, client

readme

LaunchDarkly Server-Side SDK for Node.js

NPM Actions Status Documentation

The LaunchDarkly Server-Side SDK for Node.js is designed primarily for use in multi-user systems such as web servers and applications. It follows the server-side LaunchDarkly model for multi-user contexts. It is not intended for use in desktop and embedded systems applications.

For using LaunchDarkly in client-side Node.js applications, refer to our Client-side Node.js SDK.

LaunchDarkly overview

LaunchDarkly is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. Get started using LaunchDarkly today!

Twitter Follow

Supported Node versions

This version of the LaunchDarkly SDK is compatible with Node.js versions 14 and above.

Getting started

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

Learn more

Read our documentation for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the complete reference guide for this SDK.

The authoritative description of all properties and methods is in the TypeScript documentation.

Testing

We run integration tests for all our SDKs using a centralized test harness. This approach gives us the ability to test for consistency across SDKs, as well as test networking behavior in a long-running application. These tests cover each method in the SDK, and verify that event sending, flag evaluation, stream reconnection, and other aspects of the SDK all behave correctly.

Contributing

We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this SDK.

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/node-server-sdk will be documented in this file. This project adheres to Semantic Versioning.

9.10.0 (2025-06-17)

Features

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.15.2 to 2.16.0

9.9.2 (2025-05-21)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.15.1 to 2.15.2

9.9.1 (2025-04-29)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.15.0 to 2.15.1

9.9.0 (2025-04-16)

Features

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.14.0 to 2.15.0

9.8.0 (2025-04-08)

Features

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

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.13.0 to 2.14.0

9.7.7 (2025-03-26)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.12.1 to 2.13.0

9.7.6 (2025-03-21)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.12.0 to 2.12.1

9.7.5 (2025-03-17)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.11.1 to 2.12.0

9.7.4 (2025-02-18)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.11.0 to 2.11.1

9.7.3 (2025-01-22)

Bug Fixes

  • Fix typo in proxy-authorization header for basic authentication. (#720) (220b6d6), closes #718

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.10.0 to 2.11.0

9.7.2 (2024-11-14)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.9.1 to 2.10.0

9.7.1 (2024-11-04)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.9.0 to 2.9.1

9.7.0 (2024-10-17)

Features

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

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.8.0 to 2.9.0

9.6.1 (2024-10-09)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.7.0 to 2.8.0

9.6.0 (2024-09-26)

Features

  • Add support for conditional event source capabilities. (#577) (fe82500)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.6.1 to 2.7.0

9.5.4 (2024-09-05)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.6.0 to 2.6.1

9.5.3 (2024-09-03)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.5.0 to 2.6.0

9.5.2 (2024-08-28)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.4.5 to 2.5.0

9.5.1 (2024-08-12)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.4.4 to 2.4.5

9.5.0 (2024-07-31)

Features

9.4.7 (2024-07-01)

Bug Fixes

  • Log errors when there is no error event handler. (#495) (6b73699)

9.4.6 (2024-06-14)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.4.3 to 2.4.4

9.4.5 (2024-06-04)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.4.2 to 2.4.3

9.4.4 (2024-05-31)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.4.1 to 2.4.2

9.4.3 (2024-05-22)

Bug Fixes

9.4.2 (2024-05-21)

Bug Fixes

  • Configure max backoff and jitter ratio to ensure exponential backoff. (#463) (050007d)

9.4.1 (2024-04-26)

Bug Fixes

  • Update event source to better log unexpected disconnects. (#451) (0c83afd)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.4.0 to 2.4.1

9.4.0 (2024-04-16)

Features

  • Add support for optional timeout for waitForInitialization. (#437) (c6032b3)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.3.0 to 2.4.0

9.3.0 (2024-04-10)

This release introduces a Hooks API. Hooks are collections of user-defined callbacks that are executed by the SDK at various points of interest. You can use them to augment the SDK with metrics or tracing.

Features

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.2.4 to 2.3.0

9.2.4 (2024-04-09)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.2.3 to 2.2.4

9.2.3 (2024-04-09)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.2.2 to 2.2.3

9.2.2 (2024-03-25)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.2.1 to 2.2.2

9.2.1 (2024-03-15)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.2.0 to 2.2.1

9.2.0 (2024-02-14)

Features

  • Implement handling for gzip compressed responses. (#367) (a52bee1)

9.1.1 (2024-02-08)

Bug Fixes

  • Fix an issue where failed http requests could cause an unhandled promise rejection. (#371) (dd6d0e7)

9.1.0 (2024-02-06)

Features

  • React-native support for auto-env attributes. Only affects react-native package. (deea99c)
  • Update eslint jest configuration and versions. (deea99c)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.1.3 to 2.2.0

9.0.6 (2024-01-16)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.1.2 to 2.1.3

9.0.5 (2023-12-27)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.1.1 to 2.1.2

9.0.4 (2023-12-04)

Bug Fixes

  • Increment version for changing flagValues (#317) (e8e07ef)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.1.0 to 2.1.1

9.0.3 (2023-11-14)

Bug Fixes

  • Better handle waiting for initialization for failure cases. (#314) (16515df), closes #312

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.0.2 to 2.1.0

9.0.2 (2023-11-01)

Bug Fixes

  • Correct comparison for typeof check. (#308) (568f2ab)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.0.1 to 2.0.2

9.0.1 (2023-10-16)

Bug Fixes

  • Export missed Migration types.

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 2.0.0 to 2.0.1

9.0.0 (2023-10-16)

The latest version of this SDK supports the ability to manage migrations or modernizations, using migration flags. You might use this functionality if you are optimizing queries, upgrading to new tech stacks, migrating from one database to another, or other similar technology changes. Migration flags are part of LaunchDarkly's Early Access Program. This feature is available to all LaunchDarkly customers but may undergo additional changes before it is finalized.

For detailed information about this version, refer to the list below. For information on how to upgrade from the previous version, read the migration guide.

⚠ BREAKING CHANGES

  • Implement Migrations. Refactor for client SDKs. (#293)
  • A new Migration type which provides an out-of-the-box configurable migration framework.
  • For more advanced use cases, added new migrationVariation and trackMigration methods on LdClient.
  • Added typed variation method boolVariation, stringVariation, boolVariation, numVariation, and jsonVariation for type-safe usage in TypeScript.

Features

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

Changed:

  • Changes to common code to support upcoming client-side SDKs written in TypeScript.

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.2.3 to 2.0.0

8.2.4 (2023-09-06)

Bug Fixes

  • Use clientSideAvailability instead of clientSide for filtering client side flags. (#270) (2702342)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.2.2 to 1.2.3

8.2.3 (2023-08-28)

Fixes:

  • Upgraded to launchdarkly-eventsource version 2.0.1. This includes a fix for the buffer pre-allocation algorithm and handling partial messages.
  • Ensure that flag update events are dispatched after the SDK ready event.
  • Fix an issue that could cause the SDK log warnings about usage before initialization after an error handling a flag update.

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.2.1 to 1.2.2

8.2.2 (2023-08-24)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.2.0 to 1.2.1

8.2.1 (2023-08-14)

Updated common dependency includes performance improvements.

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.1.0 to 1.2.0

8.2.0 (2023-08-14)

Features

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

Bug Fixes

  • Allow for negation of segment match clauses. (#237) (d8e469a)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.0.8 to 1.1.0

8.1.2 (2023-08-10)

Bug Fixes

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

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.0.7 to 1.0.8

8.1.1 (2023-08-03)

Bug Fixes

  • Ensure that test data user targets are handled correctly. (#223) (8a423b2)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.0.6 to 1.0.7

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 0.2.0 to 0.3.0

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 0.3.0 to 0.3.1

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.0.1 to 1.0.2

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.0.2 to 1.0.3

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.0.4 to 1.0.5

8.1.0 (2023-07-05)

Features

  • Update to launchdarkly-eventsource 2.0.0. (#199) (5b7bac9)

8.0.2 (2023-07-05)

Bug Fixes

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.0.5 to 1.0.6

8.0.0 (2023-06-26)

Introducing @launchdarkly/node-server-sdk as a replacement for launchdarkly-node-server-sdk.

  • The SDK has been re-written in Typescript.
  • The SDK has been moved to a new repository in github.
  • The SDK has a new package name.

Features

0.5.0 (2023-06-15)

Features

0.4.4 (2023-06-13)

Bug Fixes

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

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.0.3 to 1.0.4

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

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @launchdarkly/js-server-sdk-common bumped from 1.0.0 to 1.0.1

0.4.0 (2023-04-26)

Features

0.3.0 (2023-03-16)

⚠ BREAKING CHANGES

  • Make options optional in init method for @launchdarkly/node-server-sdk. (#64)

Bug Fixes

  • Make options optional in init method for @launchdarkly/node-server-sdk. (#64) (291804e)

0.2.0 (2023-03-16)

Features

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

0.1.0 (2023-03-15)

Initial prerelease version.