
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@openfeature/launchdarkly-client-provider
Advanced tools

An unofficial browser provider for LaunchDarkly.
$ npm install @openfeature/launchdarkly-client-provider
import { LaunchDarklyClientProvider } from '@openfeature/launchdarkly-client-provider';
// initialize provider
const clientEnvKey = 'LDEnvironmentID';
/*
* optional launch darkly options
* @see https://launchdarkly.github.io/js-client-sdk/interfaces/LDOptions.html
*/
const ldOptions = {
streaming: true,
};
/*
* initialization happens inside the provider, the initial context will be { anonymous: true } by default if there is not context set in Open Feature.
* @see https://launchdarkly.github.io/js-client-sdk/interfaces/LDContextCommon.html#anonymous
* you can change it using setContext.
*/
const ldOpenFeatureProvider = new LaunchDarklyClientProvider(clientEnvKey, options);
//set open feature provider and get client
OpenFeature.setProvider(ldOpenFeatureProvider);
const client = OpenFeature.getClient('my-client');
//use client
const boolValue = client.getBooleanValue('boolFlag', false);
To opt in for streaming, you should set "streaming: true"
explicitly, that guarantee you set the appropriate listeners and you enable streaming in the LD SDK
For context update always use OpenFeature.setContext(myNewContext);
Please note that context changes result in network traffic, so changes should be made sparingly in accordance to relevant user behavior.
await OpenFeature.setContext({ targetingKey: 'my-key' });
//Laundarkly uses key but this provider tranlates targetingKey to key;
//So the above is the same as doing
await OpenFeature.setContext({ key: 'my-key' });
Read more about LD contexts here
You can send custom events to LaunchDarkly metrics for use in experiments and guarded rollouts. To learn more, read Sending custom events.
const client = await OpenFeature.getClient();
client.track('event-key-123abc', { customProperty: someValue })
Run nx package providers-launchdarkly-client
to build the library.
Run nx test providers-launchdarkly-client
to execute the unit tests via Jest.
FAQs

We found that @openfeature/launchdarkly-client-provider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.