Evaluation algorithm
When you calluseFlag, useFlagValue, client.IsEnabled, or any other evaluation method, the SDK runs the following steps in order:
Reason codes
Every evaluation produces a reason code. Access it via the*Detail / useFlagVariant APIs.
Error codes
Error codes appear on results with reasonERROR.
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:targetingKey is resolved from the evaluation context using the first available value in this priority order:
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:isFetchingreturns tofalseerroris set to the fetch errororiginremains'CACHE'or'SERVER'(the source of the snapshot currently in use)