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

@spotify-confidence/openfeature-server-provider

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spotify-confidence/openfeature-server-provider

![](https://img.shields.io/badge/lifecycle-beta-a0c3d2.svg)

  • 0.0.1
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-82.61%
Maintainers
2
Weekly downloads
 
Created
Source

OpenFeature JS SDK JavaScript Confidence Provider

JavaScript implementation of the Confidence OpenFeature web provider, to be used in conjunction wth the OpenFeature JS SDK. This implements the dynamic paradigm of OpenFeature.

Usage

Adding the dependencies

To add the packages to your dependencies run:

yarn add @openfeature/js-sdk @spotify-confidence/openfeature-server-provider

Enabling the provider, setting the evaluation context and resolving flags

import { createConfidenceServerProvider } from '@spotify-confidence/openfeature-server-provider';
import { OpenFeature, OpenFeatureAPI } from '@openfeature/js-sdk';
import { fetch } from 'node-fetch';

const provider = createConfidenceServerProvider({
  clientSecret: 'mysecret',
  region: 'eu',
  fetchImplementation: fetch,
});

OpenFeature.setProvider(provider);
OpenFeature.setContext({ targetingKey: 'myTargetingKey' });

const client = OpenFeature.getClient();
const result = await client.getBooleanValue('flag.my-boolean', false, {
  someOtherContext: true,
});

FAQs

Package last updated on 03 Aug 2023

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