InvergeDocs
PHPAPI reference

Remote Config

Remote Config in the PHP SDK.

// access
$nexus->remoteConfig()

RemoteConfig

class
class Inverge\Nexus\Resource\RemoteConfig

Remote Config — fetch the active, published configuration template resolved for a given app-instance context. Conditions (platform, version, country, percentile, user properties, …) are evaluated server-side; you get back the final value for every parameter. Useful server-side for headless config, feature gating, and rendering server-driven UIs without a redeploy.

View source

__construct

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

Parameters

Prop

Type

View source

fetch()

method
function fetch(array $context = [], ?string $etag = NULL): array

Fetch and resolve the active template for this instance's context.

Pass the previous response's etag to skip the payload when nothing has changed (notModified will be true).

Parameters

Prop

Type

Returns array{version:int,etag:string,notModified:bool,throttled?:bool,parameters:array<string,array{value:mixed,valueType:string,source:?string}>}

View source

all()

method
function all(array $context = []): array

Convenience: the resolved config as a flat key => value map.

Parameters

Prop

Type

Returns array<string, — mixed>

View source

get()

method
function get(string $key, mixed $default = NULL, array $context = []): mixed

Convenience: a single parameter's resolved value, or [$default].

Parameters

Prop

Type

Returns mixed

View source

setParameter()

method
function setParameter(string $key, string $valueType, mixed $defaultValue = NULL, ?array $conditionalValues = NULL, ?string $description = NULL): array

Create or update a parameter in the draft template.

Parameters

Prop

Type

Returns array<string, — mixed> the stored parameter

View source

deleteParameter()

method
function deleteParameter(string $key): void

Remove a parameter from the draft template. */

Parameters

Prop

Type

View source

publish()

method
function publish(?string $description = NULL): array

Publish the current draft — makes all pending parameter changes live for every fetch() from now on.

Parameters

Prop

Type

Returns array{versionNumber:int,etag:string,createdAt:string}

View source

set()

method
function set(string $key, mixed $value, ?string $valueType = NULL, ?string $description = NULL): array

Convenience: set one parameter and publish it in a single call. The value type is inferred from $value unless given explicitly.

Parameters

Prop

Type

Returns array{versionNumber:int,etag:string,createdAt:string} — the new version

View source

On this page