NexusConfig is an init-only record that holds every value required to construct a NexusClient.
Field reference
Validation
A value that cannot be meant is rejected at construction withNexusConfigException, which carries
the offending property in Option:
null selects the default on every optional field, so a default is always expressible without
passing a value that means something else.
API key types
Where to keep the API key
AnywhereIConfiguration already reads - environment variables, Azure Key Vault, AWS Secrets Manager, your existing secrets pipeline. The SDK never logs the raw key.
Logging a NexusConfig
NexusConfig.ApiKey and NexusOptions.ApiKey carry [JsonIgnore] and [IgnoreDataMember], so a configuration serialized through System.Text.Json or Newtonsoft.Json contains the base URL and not the key.
Serilog’s destructuring operator honours neither. {@Config} walks public properties directly, so log a config as {Config}:
record prints its properties from the compiler-generated ToString(), so a secret bound into one reaches any log that prints it. Use a class for a type that holds a secret.
Choosing the TTL
The TTL is a tradeoff between staleness window and redundant network traffic. With SSE enabled, changes propagate in milliseconds regardless of the TTL - the TTL only matters as a safety net if the stream falls back.If SSE is connected, the SDK clamps the effective TTL to at least 60 s - there is no point polling more aggressively when the stream pushes events the moment they happen.
