Skip to main content
Flag evaluation is entirely local: it runs inside the SDK against a cached snapshot. There is no per-evaluation network call. The network is only used to periodically refresh the snapshot in the background.

Evaluation algorithm

When you call useFlag, useFlagValue, client.IsEnabled, or any other evaluation method, the SDK runs the following steps in order:
Steps 1–3 are guard checks. Steps 4–6 are the evaluation proper.

Reason codes

Every evaluation produces a reason code. Access it via the *Detail / useFlagVariant APIs.

Error codes

Error codes appear on results with reason ERROR.
FLAG_NOT_FOUND is the normal outcome when a flag is disabled. Because disabled flags are excluded from the snapshot, the SDK cannot distinguish between “flag disabled” and “flag doesn’t exist”. Both appear as FLAG_NOT_FOUND. For boolean flags this is always transparent, since both FLAG_NOT_FOUND and a disabled flag return false.

Deterministic bucketing

Rollout and traffic splits use a FNV-1a (32-bit) hash to assign each user a bucket position between 0 and 100,000. The hash input is:
The targetingKey is resolved from the evaluation context using the first available value in this priority order:
Because the hash is deterministic, the same user always lands in the same bucket for the same flag, across all SDK platforms, restarts, and devices. A user who receives true for a flag at 10% rollout will continue to receive true as that rollout expands to 20%, 50%, and 100%. If none of the bucketing keys are present in the context, rollout-based evaluation returns MISSING_TARGETING_KEY and falls back to the flag’s default value.

Snapshot caching

All SDKs refresh the snapshot on a polling interval configured server-side (default: 2 minutes). Refreshes use HTTP ETags. If the snapshot hasn’t changed, the CDN returns 304 Not Modified and no data is transferred. React Native additionally refreshes on foreground resume.

Stale snapshot behaviour

If the SDK cannot reach the CDN during a refresh attempt (network error, timeout, CDN outage), it continues using the last successfully fetched snapshot. Evaluation is uninterrupted. The client status reflects the failure:
  • isFetching returns to false
  • error is set to the fetch error
  • origin remains 'CACHE' or 'SERVER' (the source of the snapshot currently in use)
The SDK will retry on the next polling interval. As long as a snapshot has been loaded at least once, there is no degradation in flag evaluation capability during outages.