An open API service indexing awesome lists of open source software.

https://github.com/cloudbees-oss/cloudbees-openfeature-provider-browser


https://github.com/cloudbees-oss/cloudbees-openfeature-provider-browser

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# CloudBees Feature Management provider for OpenFeature

[![a](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
[![OpenFeature Specification](https://img.shields.io/static/v1?label=OpenFeature%20Specification&message=v0.5.1&color=yellow)](https://github.com/open-feature/spec/tree/v0.5.1)
[![OpenFeature SDK](https://img.shields.io/static/v1?label=OpenFeature%20SDK&message=v1.0.0&color=green)](https://github.com/open-feature/js-sdk/tree/v1.0.0)
[![npm version](https://badge.fury.io/js/cloudbees-openfeature-provider-browser.svg)](https://badge.fury.io/js/cloudbees-openfeature-provider-browser)
[![CloudBees Rox SDK](https://img.shields.io/static/v1?label=Rox%20SDK&message=v5.4.1&color=green)](https://www.npmjs.com/package/rox-browser)
[![Known Vulnerabilities](https://snyk.io/test/github/rollout/cloudbees-openfeature-provider-browser/badge.svg)](https://snyk.io/test/github/rollout/cloudbees-openfeature-provider-browser)

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-browser
```
or
```bash
yarn add cloudbees-openfeature-provider-browser
```

### Confirm peer dependencies are installed
```bash
npm install @openfeature/js-sdk
```
or
```bash
yarn add @openfeature/js-sdk
```

### Configuration

Follow the instructions on the [JS SDK project](https://github.com/open-feature/js-sdk) for how to use the SDK.

You can configure the CloudBees provider by doing the following:

```typescript
import {OpenFeature} from '@openfeature/js-sdk';
import {CloudbeesProvider} from 'cloudbees-openfeature-provider-browser'

const sdkKey = ''
OpenFeature.setProvider(await CloudbeesProvider.build(sdkKey));
const client = OpenFeature.getClient();
const value = await client.getBooleanValue('enabled-new-feature', false);
```