0.3.1 • Published 9 months ago

@xtreamsrl/react-feature-flags-growthbook v0.3.1

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

@xtreamsrl/react-feature-flags-growthbook

This package exposes an implementation of the feature flag manager that uses growthbook.

Installation

npm install @xtreamsrl/react-feature-flags-growthbook

Usage

Set up the feature flag tool to be used with configureManager by passing it an instance of the Growthbook manager and wrap the main app with the GrowthbookProvider.

// app.tsx
import { configureManager } from '@xtreamsrl/react-feature-flags';
import { GrowthbookProvider, Growthbook } from '@xtreamsrl/react-feature-flags-growthbook';

const growthbook = new Growthbook({ clientKey: 'your client key' });

configureManager({
    manager: growthbook
})

export function App() {
  return (
    <GrowthbookProvider manager={growthbook}>
      <MainApp />
    </GrowthbookProvider>
  );
}

To retrieve the flag value use the useFlag hook exported from react-feature-flags.

For more details on how to manage flags read the react-feature-flags README.

Who we are

0.3.1

9 months ago

0.3.0

1 year ago

0.2.1

1 year ago

0.1.0

2 years ago

0.1.1

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago