Skip to content

Tggl/openfeature-provider-web-js

Repository files navigation

Tggl Logo

Tggl OpenFeature Javascript Web Provider

The Typescript OpenFeature Provider to evaluate flags and report usage to the Tggl API or a proxy.

🔗 Website📚 Documentation📦 NPM🎥 Videos

Usage

Install the dependencies:

npm i @openfeature/web-sdk openfeature-web-tggl-provider

Start evaluating flags:

import { OpenFeature } from '@openfeature/web-sdk';
import { TgglWebProvider } from 'openfeature-web-tggl-provider'

await OpenFeature.setProviderAndWait(new TgglWebProvider('API_KEY'))

const client = OpenFeature.getClient();

const value = client.getBooleanValue(
  'my-feature',
  false
)

if (value) {
  console.log('Feature is enabled')
}