Skip to main content

Core API

The FlipFlagClient is the shared client used by all SDKs.

  • start(): Promise<void> — Starts polling and metrics timers.
  • stop(): void — Stops timers.
  • isEnabled(flagKey: string, defaultValue?: boolean): boolean
  • getVariant(flagKey: string, defaultValue?: FlagValue): SdkFlagEvaluation
  • getAllFlags(): Record<string, SdkFlagEvaluation>
  • updateContext(context: SdkContext): void
  • flushMetrics(): Promise<void>
  • getStatus(): { ready: boolean; error?: Error; updatedAt?: string }

Events:

  • ready — initial evaluations fetched.
  • update — evaluations refreshed.
  • error — request failed.
  • metrics — metrics flushed.