Telemetry (exposure, adopt)
Gates records three things, none of them generic analytics:
- Heartbeats. Every sync request doubles as an installation heartbeat with the device’s platform, app version, build, runtime version and update id. The dashboard uses it for active versions and for which versions have evaluated a flag.
- Exposure. Recorded when
flag()oruseFlag()reads a flag that the snapshot contains, deduplicated on the device per flag, revision and user. A new snapshot or an identity change clears the dedupe.explain()does not record exposure. - Adoption. Explicit. Call
gates.adopt("checkout-v2")when the person used the feature.
Batching
Events queue on the device and post to POST /v1/events in the background:
- A flush runs 5 seconds after the first queued event, or immediately once 20 are queued.
- The queue holds at most 200 events; the oldest are dropped beyond that.
- A network error or a 5xx keeps the batch for the next attempt. A 4xx drops it, since the server rejected it for good.
- Events queued before the installation id and runtime are known wait for them.
destroy()flushes what is left.onForeground()flushes when it does not sync.
Pass telemetry: false to the provider or createGates to send nothing. Nothing in telemetry can change what a flag evaluates to; every failure is swallowed into the optional logger.