@groundcontrolsh/groundcontrol
v0.4.3
Published
GroundControl TypeScript SDK
Downloads
2
Readme
GroundControl
TypeScript SDK for GroundControl.
Installing
With NPM
npm i @groundcontrolsh/groundcontrol
With yarn
yarn add @groundcontrolsh/groundcontrol
Usage
import { GroundControlClient } from "@groundcontrolsh/groundcontrol";
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.
// fetch: ... Pass a fetch implementation if there's not a global one defined.
});
const isEnabled = await client.isFeatureFlagEnabled("flag-name");
const isEnabledForActor = await client.isFeatureFlagEnabled("flag-name", {
actors: ["actor1234"],
});