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.
- node 14 or greater
npm install cloudbees-openfeature-provider-browseror
yarn add cloudbees-openfeature-provider-browsernpm install @openfeature/web-sdkor
yarn add @openfeature/web-sdkFollow 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);