3.2.0 • Published 9 days ago

launchdarkly-js-client-sdk v3.2.0

Weekly downloads
157,709
License
Apache-2.0
Repository
github
Last release
9 days ago

LaunchDarkly SDK for Browser JavaScript

Circle CI

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

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 see our server-side Node.js SDK, client-side Node.js SDK, and Electron SDK.

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.

ReactJS

The SDK does not require any particular JavaScript framework. However, if you are using React, there is an add-on to simplify use of the SDK. See react-client-sdk.

Browser compatibility

The LaunchDarkly SDK can be used in all major browsers. However, web browsers vary widely in their support of specific features and standards. Three features that are used by the LaunchDarkly SDK that may not be available on every browser are Promise, EventSource, and document.querySelectorAll(). For more information on whether you may need to use a polyfill to ensure compatibility, and how to do so, see "JS SDK requirements and polyfills".

Logging

By default, the SDK sends log output to the browser console. There are four logging levels: debug, info, warn, and error; by default, debug and info messages are hidden. See LDOptions.logger and basicLogger for more details.

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. Additionally, the authoritative full description of all properties, types, and methods is the online TypeScript documentation. If you are not using TypeScript, then the types are only for your information and are not enforced, although the properties and methods are still the same as described in the documentation.

For examples of using the SDK in a simple JavaScript application, see hello-js and hello-bootstrap.

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.

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
3.2.0

9 days ago

3.1.4

7 months ago

3.1.3

12 months ago

3.1.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.0-alpha.1

1 year ago

3.0.0-alpha.3

1 year ago

3.0.0-alpha.2

1 year ago

3.0.0-alpha.5

1 year ago

3.0.0-alpha.4

1 year ago

3.0.0

1 year ago

2.24.0

1 year ago

2.24.2

1 year ago

2.23.0

1 year ago

2.22.1

2 years ago

2.22.0

2 years ago

2.21.0

2 years ago

2.20.2

2 years ago

2.20.1

2 years ago

2.20.0-alpha.1

2 years ago

2.20.0-alpha.2

2 years ago

2.20.0

2 years ago

2.19.4

2 years ago

2.19.3

2 years ago

2.19.2

3 years ago

2.19.1

3 years ago

2.19.0

3 years ago

2.18.3

3 years ago

2.18.2

3 years ago

2.18.1

4 years ago

2.18.0

4 years ago

2.17.6

4 years ago

2.17.5

4 years ago

2.17.4

4 years ago

2.17.3

4 years ago

2.17.2

4 years ago

2.17.1

4 years ago

2.17.0

4 years ago

2.16.3

4 years ago

2.16.2

4 years ago

2.16.1

4 years ago

2.16.0

4 years ago

2.15.2

4 years ago

2.15.1

4 years ago

2.15.0

4 years ago

2.14.0

4 years ago

2.13.0

5 years ago

2.12.5

5 years ago

2.12.4

5 years ago

2.12.3

5 years ago

2.12.2

5 years ago

2.12.1

5 years ago

2.12.0

5 years ago

2.11.0

5 years ago

2.10.4

5 years ago

2.10.3

5 years ago