The Typescript OpenFeature Provider to evaluate flags and report usage to the Tggl API or a proxy.
🔗 Website • 📚 Documentation • 📦 NPM • 🎥 Videos
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')
}