cloudbees-openfeature-provider-node
Version:
An OpenFeature provider for CloudBees Feature Management
57 lines (41 loc) • 2.55 kB
Markdown
# CloudBees Feature Management provider for OpenFeature
[](https://www.repostatus.org/#wip)
[](https://cloud-native.slack.com/archives/C0344AANLA1)
[](https://github.com/open-feature/spec/tree/v0.5.1)
[](https://github.com/open-feature/js-sdk/tree/v1.0.0)
[](https://badge.fury.io/js/cloudbees-openfeature-provider-node)
[](https://www.npmjs.com/package/rox-node)
[](https://snyk.io/test/github/rollout/cloudbees-openfeature-provider-node)
This is the [CloudBees](https://www.cloudbees.com/products/feature-management) provider implementation for [OpenFeature](https://openfeature.dev/) for the [Javascript SDK](https://github.com/open-feature/js-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
```bash
npm install cloudbees-openfeature-provider-node
```
or
```bash
yarn add cloudbees-openfeature-provider-node
```
### Confirm peer dependencies are installed
```bash
npm install @openfeature/js-sdk
```
or
```bash
yarn add @openfeature/js-sdk
```
### Configuration
Follow the instructions on the [Javascript SDK project](https://github.com/open-feature/js-sdk) for how to use the Javascript SDK.
You can configure the CloudBees provider by doing the following:
```typescript
import {OpenFeature} from '@openfeature/js-sdk';
import {CloudbeesProvider} from 'cloudbees-openfeature-provider-node'
const appKey = 'INSERT_APP_KEY_HERE'
OpenFeature.setProvider(await CloudbeesProvider.build(appKey));
const client = OpenFeature.getClient();
const value = await client.getBooleanValue('enabled-new-feature', false);
```