Foredeck
OverviewQuickstartConfig as CodeAPI ReferenceEvaluation SpecExposuresCountersLogsMonitor your servicesSign-in & organizationsAlertingPush notificationsOpenFeature

API Reference

createClient options and ForedeckClient methods

createClient(options) → ForedeckClient

  • sdkKey, baseUrl, eventsUrl (required)
  • service, env — service/environment identity stamped automatically on every emission the SDK sends (exposure events and counter submissions), attributing telemetry to a registered Foredeck service (PRD-13)
  • tags — default tags (PRD-15) stamped automatically on every counter submission
  • pollIntervalMs (default 30000, 0 disables), bootstrap, defaults, fetch, flushIntervalMs (default 5000), maxQueueSize (default 50), exposureDedupWindowMs (default 10 min), disableExposures, disableCounters
  • config / configFile (Node, via @foredeck/sdk-js/node) — foredeck.yaml service configuration (PRD-16); onUndeclaredFlag ('warn' | 'error' | 'ignore')

Client methods

  • client.ready() — resolves after the first ruleset fetch settles
  • client.getVariation(flagKey, unitId, { skipExposure? }) → { flagKey, variation, config, reason, bucket? }
  • client.getConfigValue<T>(flagKey, unitId, param, fallback) — typed config access
  • client.count(name) / client.count(name, n) — record a counter metric submission (value 1, or n) at call time; batched + flushed asynchronously
  • client.onUpdate(cb) — ruleset-change subscription (returns unsubscribe)
  • client.assertDeclared(flagKey) — throw if the loaded config file does not declare the flag
  • client.flush() / client.close()