Skip to main content

JavaScript Client SDK

The FlagTGL JavaScript Client SDK is designed for browser-based applications. It fetches flag evaluations from the relay proxy and keeps them updated in real time.

Installation

npm install @flagtgl/js-client-sdk

Quick Start

import { FlagTGLClient } from '@flagtgl/js-client-sdk';

const client = new FlagTGLClient('your-client-sdk-key', {
key: 'user-123',
custom: { plan: 'pro' }
});

await client.waitForInitialization();
const enabled = client.variation('my-flag', false);

The client SDK is compatible with the LaunchDarkly JavaScript SDK interface. See the Migration Guide for details.

note

Full SDK reference documentation is coming soon.