Overview
Understand how FlagSync evaluates flags for users.
Flag Evaluation Flow
FlagSync evaluates flags using the same logic flow across SDKs:
Is the SDK ready?
If not, the SDK returns the defaultValue
(e.g., false
) or control
string.
Client-side SDKs can bootstrap via LocalStorage
or from an initial flag set, using those values until the SDK initializes with server data.
Does the flag key exist?
If the flag key isn’t found, the SDK returns the defaultValue
or control
.
If the flag key was included in the bootstrapped values, this value will be returned.
Is the flag disabled?
- If disabled: The default “off” variant is returned, halting further evaluation.
- If enabled: The algorithm proceeds to targeting and rollout checks.
Explore Flags: All Users to learn about default variants.
Does the flag have Targeting Rules?
- See Targeting for evaluation logic.
- See Flags: User Segments to learn about targeting rules.
Does the flag have a Percentage Rollout?
- See Rollouts for evaluation logic.
- See Flags: Percentage Rollouts to learn about rollouts.
Fallback
Returns the “on” variant if no rules or percentages apply.
See Flags: All Users to learn about default variants.
Flow Diagram
Next Steps
Dive deeper into the flag evaluation process:
- Learn targeting logic in Targeting.
- Explore rollout evaluation in Rollouts.
- Start with Quickstart: SDK