Evaluate Feature Flag
evaluate_feature_flagDry-run a feature flag against a synthetic context and explain the verdict. Nothing is written and no eval is recorded — this evaluates the live flag config in-process with the exact evaluator the server and the SDKs use, so the answer matches what the app would see. Use it to check targeting you just wrote before shipping code that depends on it. Arguments: key (required), identity (the stable id the rule buckets on — a user id, tenant id or device key), and attributes (a flat map of the values the rule tests, e.g. { "bridge:billing.entitlement.analytics": true, "privileges": ["REPORTS_VIEW"] }; dotted paths and nested objects both resolve, and roles are their KEYS). Returns the resolved value plus an explanation: which branch matched (or that none did), whether a rolloutPct bucket applied, and the bucket number. IMPORTANT: a rule with rolloutPct < 100 requires an identity; called without one the evaluator returns the safe otherwiseValue instead of bucketing, which is reported explicitly rather than looking like a targeting failure. warnings also names settings that cannot mean what they look like: switched on while the onValue is false, or a rule on a plan or role the app does not have. get_flag shows the rule being evaluated; update_feature_flag changes it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | Id of the Bridge app to act on for this call (see list_apps). Omit to use the current app. | |
| key | Yes | Flag KEY to evaluate (see list_feature_flags). | |
| identity | No | Stable per-eval identity used for sticky rollout bucketing. REQUIRED for a meaningful answer whenever the rule has rolloutPct < 100. | |
| attributes | No | Attribute values the rule conditions read. Dotted keys ("user.role") and nested objects both work. Values may be strings, numbers, booleans, objects or lists (privileges is a list of privilege keys). |