Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
launchdarkly-js-sdk-common
Advanced tools
The launchdarkly-js-sdk-common package is a JavaScript SDK for LaunchDarkly, a feature management platform that allows developers to control the release of features to users. This SDK provides the core functionality for interacting with LaunchDarkly's feature flagging and experimentation capabilities.
Initialize the SDK
This feature allows you to initialize the LaunchDarkly client with your environment key and user information. The client can then be used to interact with LaunchDarkly's feature flags.
const { initialize } = require('launchdarkly-js-sdk-common');
const client = initialize('YOUR_ENVIRONMENT_KEY', { key: 'user_key' });
Evaluate Feature Flags
Once the client is ready, you can evaluate feature flags using the `variation` method. This method takes the feature flag key and a default value, returning the flag's value for the user.
client.on('ready', () => {
const showFeature = client.variation('your-feature-flag-key', false);
console.log('Feature flag value:', showFeature);
});
Track Custom Events
This feature allows you to track custom events in LaunchDarkly. You can send event data that can be used for analytics and experimentation purposes.
client.track('custom-event-key', { customData: 'value' });
Close the Client
This feature allows you to close the LaunchDarkly client, ensuring that all pending events are sent before the application exits.
client.close();
The unleash-client package is a feature management client for the Unleash feature flagging system. It provides similar functionality to LaunchDarkly, allowing developers to control feature releases and track feature usage. Unlike LaunchDarkly, Unleash is an open-source solution that can be self-hosted.
Flagr is an open-source feature flagging and A/B testing tool. The flagr-client package allows developers to interact with the Flagr API to evaluate feature flags and track events. Flagr provides a similar feature set to LaunchDarkly but is designed to be self-hosted and customizable.
LaunchDarkly is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. Get started using LaunchDarkly today!
This project provides core implementation components for all of the LaunchDarkly client-side SDKs that use JavaScript: the JS (browser) SDK, the React SDK, the client-side Node SDK, and the Electron SDK. Application code should never refer to the launchdarkly-js-sdk-common
package directly.
The initialize
function in index.js
creates the basic client object that all of those SDKs are built upon. The SDK's own initialize
function calls this function, providing a "platform" object that defines additional capabilities specific to that SDK, and then optionally decorates the client object with any other public methods or properties it should have. Inasmuch as possible, the SDK code contains only what is necessary to distinguish it from the other JavaScript-based SDKs. For instance, this project contains no browser-specific code; that is all in js-client-sdk
.
It also provides TypeScript definitions in index.d.ts
which are re-exported or extended by the SDKs, so the Typedoc documentation for the SDKs includes them.
We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this project.
FAQs
LaunchDarkly SDK for JavaScript - common code
The npm package launchdarkly-js-sdk-common receives a total of 832,059 weekly downloads. As such, launchdarkly-js-sdk-common popularity was classified as popular.
We found that launchdarkly-js-sdk-common demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.