Remote Config
Remote Config in the .NET SDK.
RemoteConfigResource
classclass Inverge.Nexus.Resources.RemoteConfigResourceRemote 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 methodstatic string InferValueType(object? value)Maps a CLR value onto a Remote Config value type.
Parameters
Prop
Type
Returns string
Defaults
propertyIReadOnlyDictionary<string, object?> Defaults { get; }The in-app defaults currently registered.
DeleteParameterAsync()
methodTask DeleteParameterAsync(string key, CancellationToken cancellationToken = default)Removes a parameter from the draft template.
Parameters
Prop
Type
FetchAsync()
methodTask<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()
methodTask<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()
methodTask<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()
methodTask<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()
methodTask<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()
methodTask<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()
methodvoid Invalidate()Drops the in-process cache, so the next read refetches.
PublishAsync()
methodTask<RemoteConfigPublishResult> PublishAsync(string? description = null, CancellationToken cancellationToken = default)Makes the draft live, and drops the local cache.
Parameters
Prop
Type
Returns Task<RemoteConfigPublishResult>
SetAsync()
methodTask<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()
methodvoid 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()
methodTask<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>
