Socket
Book a DemoInstallSign in
Socket

@openfeature/growthbook-provider

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openfeature/growthbook-provider

## Installation

latest
npmnpm
Version
0.1.2
Version published
Weekly downloads
319
12.72%
Maintainers
0
Weekly downloads
 
Created
Source

growthbook Provider

Installation

$ npm install @openfeature/growthbook-provider

Example Setup

import { GrowthBookClient, ClientOptions, InitOptions } from '@growthbook/growthbook';
import { GrowthbookProvider } from '@openfeature/growthbook-provider';
import { OpenFeature } from '@openfeature/server-sdk';

/*
 * Configure your GrowthBook instance with GrowthBook context
 * @see https://docs.growthbook.io/lib/js#step-1-configure-your-app
 */
const gbClientOptions: ClientOptions = {
  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 GrowthbookProvider(gbClientOptions, initOptions));

Building

Run nx package providers-growthbook to build the library.

Running unit tests

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

FAQs

Package last updated on 10 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts