cloudbees-openfeature-provider-browser
v1.1.0
Published
An OpenFeature provider for CloudBees Feature Management
Readme
CloudBees Feature Management provider for OpenFeature
This is the CloudBees provider implementation for OpenFeature for the Web SDK.
OpenFeature provides a vendor-agnostic abstraction layer on Feature Flag management.
This provider allows the use of CloudBees Feature Management as a backend for Feature Flag configurations.
Requirements
- node 14 or greater
Installation
Add it to your build
npm install cloudbees-openfeature-provider-browseror
yarn add cloudbees-openfeature-provider-browserConfirm peer dependencies are installed
npm install @openfeature/web-sdkor
yarn add @openfeature/web-sdkConfiguration
Follow the instructions on the Web SDK project for how to use the SDK.
You can configure the CloudBees provider by doing the following:
import {OpenFeature} from '@openfeature/web-sdk';
import {CloudbeesProvider} from 'cloudbees-openfeature-provider-browser'
const sdkKey = '<INSERT_SDK_KEY_HERE>'
OpenFeature.setProvider(await CloudbeesProvider.build(sdkKey));
const client = OpenFeature.getClient();
const value = await client.getBooleanValue('enabled-new-feature', false);