Feature flags
Feature flags — evaluate the environment's active flags for one person.
// access
client.flagsFeature flags — evaluate the environment's active flags for one person.
Flags
classclient.flags
Every helper performs one evaluation call. When you need several flags for
the same user, call evaluate once and ask the result:
flags = client.flags.evaluate("user_1", {"plan": "pro"})
if flags.is_enabled("new_checkout"):
...
theme = flags.payload("paywall")Extends Resource.
evaluate()
methoddef evaluate(distinct_id=None, properties=None, **extra_properties) -> FlagEvaluationEvaluate every active flag for a person.
distinct_id falls back to the ambient nexus.context.
Parameters
Prop
Type
Returns FlagEvaluation
all()
methoddef all(distinct_id=None, properties=None, **extra_properties) -> Mapping[str, Any]Flat {key: bool | variant} map.
Parameters
Prop
Type
Returns Mapping[str, Any]
is_enabled()
methoddef is_enabled(key, distinct_id=None, properties=None, *, default=False, **extra_properties) -> boolWhether a flag is on, or default if it can't be evaluated.
Parameters
Prop
Type
Returns bool
variant()
methoddef variant(key, distinct_id=None, properties=None, *, default=None, **extra_properties) -> Optional[str]The resolved variant of a multivariate flag, else default.
Parameters
Prop
Type
Returns Optional[str]
payload()
methoddef payload(key, distinct_id=None, properties=None, *, default=None, **extra_properties) -> AnyThe flag's attached JSON payload, or default.
default is keyword-only so a third positional argument can't be
mistaken for it — that slot is the targeting properties.
Parameters
Prop
Type
Returns Any
