@openfeature/growthbook-client-provider
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

growthbook-client Provider

Installation

$ npm install @openfeature/growthbook-client-provider

Example Setup

import { GrowthBook, Context, InitOptions } from '@growthbook/growthbook';
import { GrowthbookClientProvider } from '@openfeature/growthbook-client-provider';

/*
 * Configure your GrowthBook instance with GrowthBook context
 * @see https://docs.growthbook.io/lib/js#step-1-configure-your-app
 */
const gbContext: Context = {
  apiHost: 'https://cdn.growthbook.io',
  clientKey: 'sdk-abc123',
  // Only required if you have feature encryption enabled in GrowthBook
  decryptionKey: 'key_abc123',
};

/*
 * optional init options
 * @see https://docs.growthbook.io/lib/js#switching-to-init
 */
const initOptions: InitOptions = {
  timeout: 2000,
  streaming: true,
};

OpenFeature.setProvider(new GrowthbookClientProvider(gbContext, initOptions));

Building

Run nx package providers-growthbook-client to build the library.

Running unit tests

Run nx test providers-growthbook-client to execute the unit tests via Jest.

Readme

Keywords

none

Package Sidebar

Install

npm i @openfeature/growthbook-client-provider

Weekly Downloads

101

Version

0.1.1

License

none

Unpacked Size

22.6 kB

Total Files

12

Last publish

Collaborators

  • beeme1mr
  • toddbaert