FeatureFlagService
Source: FeatureFlagService.js:24
Service responsible for initializing and querying feature flags.
This service initializes the client once and exposes helper methods to validate configuration and to read feature flag values.
Constructor
new FeatureFlagService(): FeatureFlagServiceCreate a new FeatureFlagService and start initialization. The initialization promise resolves when the client emits the synchronized event.
Instance Methods
isEnabled(flagName: FeatureFlagKey): Promise.<boolean>
Check whether a feature flag is enabled.
Waits for the client to finish initialization before querying. Returns false when feature flags are not configured.
Parameters
flagName(FeatureFlagKey) — The feature flag key to check.
Returns
Promise.<boolean>— True if the flag is enabled; otherwise false.
getAll(): Promise.<Array.<{name: string, enabled: boolean}>>
Retrieve all feature flag definitions.
Filters out stale flags and returns an array of simplified flag states. Returns an empty array when feature flags are not configured.
Returns
Promise.<Array.<{name: string, enabled: boolean}>>— Array of feature flag states.