Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openfeature/js-sdk

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openfeature/js-sdk

OpenFeature SDK for JavaScript

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4K
increased by84.3%
Maintainers
2
Weekly downloads
 
Created
Source

OpenFeature SDK for JavaScript

a codecov npm version Known Vulnerabilities Specification

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.

Installation

npm install @openfeature/js-sdk

or

yarn add @openfeature/js-sdk

Usage

import { OpenFeature } from '@openfeature/js-sdk';

OpenFeature.setProvider(new MyProvider());

const client = OpenFeature.getClient();

const value = await client.getBooleanValue('enabled-new-feature', false);

Development

Installation and Dependencies

Install dependencies with npm ci. npm install will update the package-lock.json with the most recent compatible versions.

We value having as few runtime dependencies as possible. The addition of any dependencies requires careful consideration and review.

Testing

Run tests with npm test.

Packaging

Both ES modules and CommonJS modules are supported, so consumers can use both require and import functions to utilize this module. This is accomplished by building 2 variations of the output, under dist/esm and dist/cjs, respectively. To force resolution of the dist/esm/**.js* files as modules, a package json with only the context {"type": "module"} is included at a in a postbuild step. Type declarations are included at /dist/types/

For testing purposes, you can add a comment containing "/publish" in any PR. This will publish an experimental SDK version with the git SHA appended to the version number.

Contributors

Thanks so much to our contributors.

Made with contrib.rocks.

License

Apache License 2.0

Keywords

FAQs

Package last updated on 03 Oct 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc