UseFeatureFlagsOptions
Creates feature flag accessors from an RTK Query API instance.
Injects a GET {basePath}/flagConfiguration endpoint into the API and returns
accessors for reading flag values. Fetches once on mount and caches via
RTK Query. Both api and basePath should be stable references.
Example
const { getFlag, getVariant } = useFeatureFlags(terrenoApi);
const showNewCheckout = getFlag("new-checkout-flow"); // true | false
const variant = getVariant("checkout-experiment"); // "control" | "variant-a" | null
Properties
basePath?
optionalbasePath?:string
domain?
optionaldomain?:string
skip?
optionalskip?:boolean
socket?
optionalsocket?: {off: (event,handler) =>void;on: (event,handler) =>void; } |null
socketEventName?
optionalsocketEventName?:string
userId?
optionaluserId?:string|null