openfeature-server-tggl-provider
v1.1.1
Published
Tggl Typescript Server OpenFeature Provider
Downloads
192
Maintainers
Readme
Usage
Install the dependencies:
npm i @openfeature/server-sdk openfeature-server-tggl-provider
Start evaluating flags:
import { OpenFeature } from '@openfeature/server-sdk';
import { TgglServerProvider } from 'openfeature-server-tggl-provider'
await OpenFeature.setProviderAndWait(new TgglServerProvider('API_KEY'))
const client = OpenFeature.getClient();
const value = await client.getBooleanValue(
'my-feature',
false,
{ userId: 'foo' }
)
if (value) {
console.log('Feature is enabled')
}