0.3.0 • Published 8 months ago

@groundcontrolsh/react v0.3.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

GroundControl

GroundControl

React SDK for GroundControl.

Installing

With NPM

npm i @groundcontrolsh/groundcontrol @groundcontrolsh/react

With yarn

yarn add @groundcontrolsh/groundcontrol @groundcontrolsh/react

Usage

import { GroundControlClient } from "@groundcontrolsh/groundcontrol";
import { GroundControlProvider, useFeatureFlag } from "@groundcontrolsh/react";

// In your top-most component tree
const client = new GroundControlClient({
  projectId: "YOUR_PROJECT_ID",
  apiKey: "YOUR_API_KEY",
  cache: 60, // Optional. For how long results are cached in seconds. Defaults to not caching.
});

function App() {
  // The cache prop defines for how long results are cached in seconds. Defaults to not caching.
  return <GroundControlProvider client={client}>...</GroundControlProvider>;
}

// In your components
function MyComponent() {
  const isEnabled = useFeatureFlag("flag-name");
  const isEnabledForActor = useFeatureFlag("flag-name", {
    actors: ["actor1234"],
  });

  // ...
}
0.3.0

8 months ago

0.2.4

12 months ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago