FlagDiligence docs
Core concepts
The few ideas that everything else is built on.
How things are organised
| Term | What it is |
|---|---|
| Organization | The top-level workspace for your company or team. It holds projects and members. |
| Project | The flags for one application or service. |
| Environment | A deployment stage such as Development, Staging or Production. Each has its own flag settings, rules and SDK keys. |
| Flag | A switch in your code that FlagDiligence controls. |
| Variation | A value a flag can return. |
| Segment | A reusable group of users that you can target from many flags. |
| SDK key | The key that connects your code to one environment. |
Flag types
| Type | Use it for | Example values |
|---|---|---|
| Boolean | On or off | true, false |
| String | Choosing between named options | "control", "variant-a" |
| Number | Limits and thresholds | 10, 2.5 |
| JSON | Several settings at once | {"theme":"dark","limit":10} |
Environments are independent
A flag can be on in Staging and off in Production. Rules, rollout percentage and variations are set per environment, and each environment has its own SDK keys. A key from one environment never reads another environment’s flags.
Each environment has a server key (keep it secret, use it only on servers) and a client key (safe to ship in front-end code). Regenerating a key invalidates the old one immediately.
How a flag is evaluated
- Is the flag on?If it is off in this environment, the user gets the OFF variation.
- Does a rule match?Rules are checked in priority order, lowest number first. The first rule that matches decides the value.
- OtherwiseThe user gets the default (fallthrough) value, which can include a percentage rollout.
Percentage rollouts are sticky. A given user key always lands in the same bucket, so the same person gets the same experience until you change the percentage. This is why every user needs a stable key.
Why a value was returned
The Node.js SDK can tell you the reason with variationDetail:
| Reason | Meaning |
|---|---|
| OFF | The flag is off in this environment. |
| FALLTHROUGH | No rule matched, so the default was used. |
| TARGET_MATCH | The user was targeted directly. |
| RULE_MATCH | A targeting rule matched. |
| PREREQUISITE_FAILED | A flag this one depends on was not satisfied. |
| ERROR | Evaluation failed and the default was returned. |
Need help with FlagDiligence?
Open the app, or tell us what you are trying to do.
