InvergeDocs
.NETAPI reference

Remote Config

Remote Config in the .NET SDK.

RemoteConfigResource

class
class Inverge.Nexus.Resources.RemoteConfigResource

Remote Config — server-evaluated, publishable configuration.

This is how you change behaviour without a deploy: a fee, a phone number, a copy string, a kill switch. Conditions (platform, version, country, percentile, custom attributes) are evaluated server-side, so the values that arrive are final.

Reads are cached in-process for RemoteConfigCacheTtl and revalidated with the previous ETag, so a hot path can read freely. Writes edit a draft: nothing changes for anyone until PublishAsync.

InferValueType()

static method
static string InferValueType(object? value)

Maps a CLR value onto a Remote Config value type.

Parameters

Prop

Type

Returns string

Defaults

property
IReadOnlyDictionary<string, object?> Defaults { get; }

The in-app defaults currently registered.

DeleteParameterAsync()

method
Task DeleteParameterAsync(string key, CancellationToken cancellationToken = default)

Removes a parameter from the draft template.

Parameters

Prop

Type

FetchAsync()

method
Task<RemoteConfigSnapshot> FetchAsync(IReadOnlyDictionary<string, object?>? context = null, bool fresh = false, CancellationToken cancellationToken = default)

Resolves the active template for a context.

Parameters

Prop

Type

Returns Task<RemoteConfigSnapshot>

GetBooleanAsync()

method
Task<bool> GetBooleanAsync(string key, bool fallback = false, IReadOnlyDictionary<string, object?>? context = null, CancellationToken cancellationToken = default)

One parameter's resolved value, as a boolean.

Parameters

Prop

Type

Returns Task<bool>

GetInt32Async()

method
Task<int> GetInt32Async(string key, int fallback = 0, IReadOnlyDictionary<string, object?>? context = null, CancellationToken cancellationToken = default)

One parameter's resolved value, as an integer.

Parameters

Prop

Type

Returns Task<int>

GetJsonAsync()

method
Task<JsonNode?> GetJsonAsync(string key, JsonNode? fallback = null, IReadOnlyDictionary<string, object?>? context = null, CancellationToken cancellationToken = default)

One parameter's resolved value, as JSON.

Parameters

Prop

Type

Returns Task<JsonNode?>

GetNumberAsync()

method
Task<double> GetNumberAsync(string key, double fallback = 0, IReadOnlyDictionary<string, object?>? context = null, CancellationToken cancellationToken = default)

One parameter's resolved value, as a number.

Parameters

Prop

Type

Returns Task<double>

GetStringAsync()

method
Task<string> GetStringAsync(string key, string fallback = "", IReadOnlyDictionary<string, object?>? context = null, CancellationToken cancellationToken = default)

One parameter's resolved value, as a string.

Parameters

Prop

Type

Returns Task<string>

Invalidate()

method
void Invalidate()

Drops the in-process cache, so the next read refetches.

PublishAsync()

method
Task<RemoteConfigPublishResult> PublishAsync(string? description = null, CancellationToken cancellationToken = default)

Makes the draft live, and drops the local cache.

Parameters

Prop

Type

Returns Task<RemoteConfigPublishResult>

SetAsync()

method
Task<RemoteConfigPublishResult> SetAsync(string key, object? value, string? valueType = null, string? description = null, CancellationToken cancellationToken = default)

Sets one parameter and publishes it in a single step.

Parameters

Prop

Type

Returns Task<RemoteConfigPublishResult>

SetDefaults()

method
void SetDefaults(IReadOnlyDictionary<string, object?> defaults)

Registers in-app fallbacks, used when the template does not define a key or the fetch fails.

Set these at startup. They are what keeps a config outage from changing behaviour: without a default, a missing key silently reads as zero, false or empty.

Parameters

Prop

Type

SetParameterAsync()

method
Task<NexusAck> SetParameterAsync(string key, object? value = null, string? valueType = null, IReadOnlyDictionary<string, object?>? conditionalValues = null, string? description = null, CancellationToken cancellationToken = default)

Creates or updates a parameter in the draft template.

Nothing changes for clients until PublishAsync.

Parameters

Prop

Type

Returns Task<NexusAck>

On this page