InvergeDocs
PHPAPI reference

Feature flags

Feature flags in the PHP SDK.

// access
$nexus->flags()

Flags

class
class Inverge\Nexus\Resource\Flags

Feature flags — evaluate a project's active flags for a specific person. Response shape: { flags: {key: bool|variantString}, payloads: {key: mixed} }.

View source

__construct

constructor
function __construct(Inverge\Nexus\NexusClient $client)

Parameters

Prop

Type

View source

evaluate()

method
function evaluate(string $distinctId, array $properties = []): array

Evaluate every active flag for $distinctId.

Parameters

Prop

Type

Returns array{flags:array<string,bool|string>,payloads:array<string,mixed>}

View source

isEnabled()

method
function isEnabled(string $key, string $distinctId, array $properties = []): bool

Whether a flag is on for the person. Boolean flags → their value; multivariate flags → true when a variant resolved.

Parameters

Prop

Type

Returns bool

View source

variant()

method
function variant(string $key, string $distinctId, array $properties = []): ?string

The resolved variant key for a multivariate flag (null for boolean/off).

Parameters

Prop

Type

Returns ?string

View source

payload()

method
function payload(string $key, string $distinctId, array $properties = []): mixed

The flag's JSON payload for the person (null when disabled/absent).

Parameters

Prop

Type

Returns mixed

View source

On this page