This package (`launchdarkly-js-sdk-common`) serves as the foundational core for all client-side JavaScript-based LaunchDarkly SDKs, including the browser, React, client-side Node, and Electron SDKs. It provides the essential, platform-agnostic implementation components, such as the `initialize` function used to create the basic client object and shared TypeScript definitions. Crucially, application developers should not directly reference or import from this package; it is an internal dependency for other LaunchDarkly SDKs. The current stable version is 5.8.0, with minor releases occurring frequently, often monthly or bi-monthly, introducing new features and bug fixes to support broader LaunchDarkly platform capabilities. Its key differentiator is providing a consistent, shared codebase to reduce duplication and ensure behavioral parity across various JavaScript environments for the LaunchDarkly ecosystem.
npm install launchdarkly-js-sdk-commonVerified import paths — ran on the pinned version, not inferred.
This TypeScript example illustrates how a higher-level LaunchDarkly SDK (like `js-client-sdk`) internally utilizes `launchdarkly-js-sdk-common`'s `initialize` function with a platform object and basic options to create a core `LDClient` instance, and demonstrates its internal event handling and variation fetching.
Use a specific LaunchDarkly SDK package relevant to your environment (e.g., `launchdarkly-js-client-sdk` for browsers or Node.js, `launchdarkly-react-client-sdk` for React applications) rather than directly importing from `launchdarkly-js-sdk-common`.
Ensure your environment provides stable streaming connectivity or configure specific SDKs to use polling if streaming is not viable. Consult the documentation for your specific LaunchDarkly SDK for alternative connection methods.
Review any custom event processing or data pipelines that consume LaunchDarkly events to ensure compatibility with the updated event structure and redaction policies.
Ensure the package is installed (`npm install launchdarkly-js-sdk-common`). For modern JavaScript, prefer `import` statements. Most importantly, ensure you are using a public-facing LaunchDarkly SDK, which will handle its internal dependency on `launchdarkly-js-sdk-common`.
Ensure `initialize` is imported as a named export: `import { initialize } from 'launchdarkly-js-sdk-common';`. Remember that this function is primarily for internal SDK use and not typically invoked directly by application code.When using a concrete LaunchDarkly client instance obtained from a specific SDK (e.g., `launchdarkly-js-client-sdk`), ensure you cast or type the client object to that SDK's specific client type (e.g., `LDBrowserClient`) to correctly access all its public API methods.
No dependency data recorded yet.