Creates a new FeatureReader instance.
Configuration options including Firestore instance, workspace, and optional user context
Protected ReadonlydbProtectedprefetchStaticFeatureFetches a named feature condition.
The name of the condition
The feature condition logic, or null if not found
Fetches a single feature flag by name.
The unique name of the feature flag
A Feature instance for evaluation, or null if not found
Fetches a single archived feature flag.
The unique name of the archived feature flag
A Feature instance, or null if not found
Fetches all active feature flags in the current workspace.
A record of flag names to Feature instances
Fetches a segment group by name.
The name of the segment
A SegmentGroup instance, or null if not found
ProtectedsafeProtectedsafeOptionalonError: (error: Error) => voidOptionalonError: (error: Error) => voidSubscribes to real-time updates for a single feature flag.
Name of the flag to watch
Callback triggered when the flag data changes
OptionalonError: (error: Error) => voidOptional error callback
Unsubscribe function
Subscribes to real-time updates for all feature flags in the workspace.
Callback triggered when any flag in the collection changes
OptionalonError: (error: Error) => voidOptional error callback
Unsubscribe function
Firebase-backed reader for feature flags, segments, and conditions.
This class provides methods to fetch and subscribe to feature flag data from Firestore. it handles workspace fallbacks (global vs specific) and maintains an internal cache for performance.
Example