0.1.2 • Published 9 months ago

@xtreamsrl/react-feature-flags-launchdarkly v0.1.2

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

@xtreamsrl/react-feature-flags-launchdarkly

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

Installation

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

Usage

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

// app.tsx
import { configureManager } from '@xtreamsrl/react-feature-flags';
import { LaunchdarklyProvider, LaunchDarkly } from '@xtreamsrl/react-feature-flags-launchdarkly';

const launchdarkly = new LaunchDarkly('your client id');

configureManager({
  manager: launchdarkly
})

export function App() {
  return (
    <LaunchdarklyProvider manager={launchdarkly}>
      <MainApp />
    </LaunchdarklyProvider>
  );
}

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.1.2

9 months ago

0.1.1

1 year ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago