Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@openfeature/js-sdk
Advanced tools
OpenFeature SDK for JavaScript
This is the JavaScript implementation of OpenFeature, a vendor-agnostic abstraction library for evaluating feature flags.
We support multiple data types for flags (numbers, strings, booleans, objects) as well as hooks, which can alter the lifecycle of a flag evaluation.
This library is intended to be used in server-side contexts and has only experimental support for web usage.
npm install @openfeature/js-sdk
or
yarn add @openfeature/js-sdk
import { OpenFeature } from '@openfeature/js-sdk';
// configure a provider
OpenFeature.setProvider(new YourProviderOfChoice());
// create a client
const client = OpenFeature.getClient('my-app');
// get a bool value
const boolValue = await client.getBooleanValue('boolFlag', false);
// get a string value
const stringValue = await client.getStringValue('stringFlag', 'default');
// get an numeric value
const numberValue = await client.getNumberValue('intFlag', 1);
// get an object value
const object = await client.getObjectValue<MyObject>('objectFlag', {});
// add a value to the invocation context
const context: EvaluationContext = {
myInvocationKey: 'myInvocationValue',
};
const contextAwareValue = await client.getBooleanValue('boolFlag', false, context);
For complete documentation, visit: https://docs.openfeature.dev/docs/category/concepts
See CONTRIBUTING.md for details on how to contribute to the OpenFeature project.
Our community meetings are held regularly and open to everyone. Check the OpenFeature community calendar for specific dates and for the Zoom meeting links.
Thanks so much to our contributors.
Made with contrib.rocks.
FAQs
OpenFeature SDK for JavaScript
The npm package @openfeature/js-sdk receives a total of 3,224 weekly downloads. As such, @openfeature/js-sdk popularity was classified as popular.
We found that @openfeature/js-sdk demonstrated a not healthy version release cadence and project activity because the last version was released 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.