Flags
webDeveloper
The ScaleBun.flags namespace — 8 members.
Feature flags: - scalebun.flags.isEnabled('new-checkout') — boolean gate. - scalebun.flags.variation('cta-color', '#000') — F2 multivariate served value (typed). - scalebun.flags.variationDetail('cta-color', '#000') — F2 { value, variant, reason } (LD-style). Each read records one exposure (variant name when multivariate, else the boolean).
TypeScript
import ScaleBun from '@scalebun/web';
ScaleBun.flags.<method>(…);Members#
| Member | Signature |
|---|---|
isEnabled | isEnabled(key: string): boolean |
variation | variation(key: string, fallback: T): T |
variationDetail | variationDetail(key: string, fallback: T): VariationDetail<T> |
ready | ready(): Promise<void> |
onChange | onChange(cb: () => void): (() => void) |
override | override(key: string, value: unknown): void |
clearOverride | clearOverride(key: string): void |
clearOverrides | clearOverrides(): void |
Reference#
isEnabled#
TypeScript
ScaleBun.flags.isEnabled(key: string): booleanvariation#
TypeScript
ScaleBun.flags.variation(key: string, fallback: T): TvariationDetail#
TypeScript
ScaleBun.flags.variationDetail(key: string, fallback: T): VariationDetail<T>ready#
TypeScript
ScaleBun.flags.ready(): Promise<void>onChange#
TypeScript
ScaleBun.flags.onChange(cb: () => void): (() => void)override#
TypeScript
ScaleBun.flags.override(key: string, value: unknown): voidclearOverride#
TypeScript
ScaleBun.flags.clearOverride(key: string): voidclearOverrides#
TypeScript
ScaleBun.flags.clearOverrides(): void