InvergeDocs
.NETAPI reference

Feature flags

Feature flags in the .NET SDK.

FlagsResource

class
class Inverge.Nexus.Resources.FlagsResource

Feature flags, evaluated server-side for one person.

Every helper here performs one evaluation call, and one call resolves every flag in the environment. When a request needs several flags, call EvaluateAsync once and ask the result — three IsEnabledAsync calls are three round trips for data you already had after the first.

The convenience helpers degrade instead of throwing. A flag lookup is a decision point, not a data fetch: letting a Nexus hiccup turn into a 500 on a page that would otherwise render is the wrong trade. EvaluateAsync still throws, so you can handle failure explicitly where it matters.

EvaluateAsync()

method
Task<FlagEvaluation> EvaluateAsync(string? distinctId = null, object? properties = null, CancellationToken cancellationToken = default)

Evaluates every active flag for a person.

Parameters

Prop

Type

Returns Task<FlagEvaluation>

IsEnabledAsync()

method
Task<bool> IsEnabledAsync(string key, string? distinctId = null, object? properties = null, bool fallback = false, CancellationToken cancellationToken = default)

Whether a flag is on, or fallback if it cannot be evaluated.

Parameters

Prop

Type

Returns Task<bool>

PayloadAsync()

method
Task<JsonNode?> PayloadAsync(string key, string? distinctId = null, object? properties = null, JsonNode? fallback = null, CancellationToken cancellationToken = default)

A flag's attached JSON payload, or fallback.

Parameters

Prop

Type

Returns Task<JsonNode?>

VariantAsync()

method
Task<string?> VariantAsync(string key, string? distinctId = null, object? properties = null, string? fallback = null, CancellationToken cancellationToken = default)

The resolved variant of a multivariate flag, or fallback.

Parameters

Prop

Type

Returns Task<string?>

On this page