Skip to main content
An exposure records that a target saw a control-point value. Records queue in-process, deduplicate, and drain on flush. OpenFeature and the wire still say flagKey. The capture body uses type: "exposure". fw-server may map that to a vendor $feature_flag_called — SDKs never emit that name on the public FireWeave wire. This is not OpenFeature Tracking (spec §6). provider.track is not implemented.

Why it exists

Evaluation is side-effect-free by default so a read does not imply “we showed this variant.” You opt in when you need assignment proof — analytics, holdouts, or correlating a Decision to a release.

When to use it

  • Pass sendExposure: true (or language equivalent) on evaluate when this call is the serve
  • Call exposures.record when you evaluated once and served many users, or you need extra correlation (rolloutId)
  • Always flush before you care that the queue left the process — especially on Java
Do not assume evaluate emits an exposure. The default is false in all five packages.

How it relates

When an exposure happens

Do not document emit-on-evaluate as the default. Ruling 20: sendExposure defaults false everywhere.

Dedup, batching, flush

Dedup key (Node, Python, Go, and the extensions contract): (targetingKey, flagKey, variant, value).
  • Duplicates return ok with deduped: true and are not re-queued.
  • The seen-set clears on flush so it cannot grow for the process lifetime. The same tuple can queue again after a flush.
flush drains the queue to the adapter sink (POST /v1/capture on the remote adapter). Return shape is typically { ok, flushed, queued } (Go returns a count + error). Web also flushes on visibilitychange → hidden and pagehide, using keepalive fetch and sendBeacon as a fallback. sendBeacon cannot set Authorization; keepalive fetch is preferred.

Shutdown

Default shutdown timeout is 10_000 ms where the runtime exposes one.

Failure behavior

  • Evaluate still never throws if exposure emission fails. A failed sink does not change the Decision.
  • record / flush degrade with result objects (Go: error) — NotReady / UnsupportedCapability before READY, AlreadyClosed after shutdown.
  • Node flush maps adapter flush exceptions to a Network (or existing FireweaveError) result.
  • Python flush swallows sink exceptions so telemetry loss cannot break callers.
  • Empty targetingKey or flagKey on Node recordInvalidContext.
  • Evaluate-path emission with an empty targetingKey is skipped (Node).
Delivery to fw-server after flush is NEEDS VERIFICATION per adapter (same skew as releases).

API

Last modified on August 18, 2026