FeatureFlagService

Source: FeatureFlagService.ts:34

Client-side FeatureFlagService using the a proxy client.

The service starts the client once and exposes helper methods to check whether flags are enabled. Consumers should await the initialization before querying flags to ensure the client has fetched the current toggle state.


Constructor

new FeatureFlagService(): FeatureFlagService

Initialize the service and start background polling.


Instance Methods

isEnabled(flagName: string): Promise.<boolean>

Check whether a feature flag is enabled.

Waits for the client to finish initial startup before querying. Logs a warning for unknown flags.

Parameters

  • flagName (string) — The feature flag key to check.

Returns

  • Promise.<boolean> — Resolves to true when the flag is enabled.