IConfigurationSource / IConfigurationProvider implementation. With a single AddWestyx(...) call, all Nexus config values are exposed through IConfiguration — so you can bind them to IOptions<T> classes, read them via configuration["key"], and receive live IOptionsMonitor<T> updates when a value changes in the console.
Basic setup
AddWestyx performs a blocking initial sync inside Build() — the same pattern used by Azure App Configuration and other standard providers. All Nexus config values are available from the moment builder.Build() returns.
The SSE live-update stream starts automatically (enableStream: true is the default). Turn it off if you prefer TTL-only polling:
Binding to IOptions<T>
After callingAddWestyx, bind Nexus configs to a strongly-typed class the same way you would bind any other configuration section:
IOptions<DatabaseSettings> where you need it:
Live reload with IOptionsMonitor<T>
When the SSE stream is running, the configuration provider callsIConfiguration.Reload() automatically after every sync that returns new data. This means IOptionsMonitor<T> receives change notifications within milliseconds of a value being updated in the Nexus console — without a restart.
Live reload requires
ConnectStream() to be active. AddWestyx(config) starts the stream automatically. If you use the pre-created client overload, call client.ConnectStream() yourself before registering the source.Pre-created client (WIF, advanced lifetime)
If you need WIF authentication or want to manage the client lifetime yourself, pass an existingNexusClient to the overload:
builder.Services.AddSingleton(client) registration ensures the host shuts the client down cleanly.
Reading configs directly from IConfiguration
You can also read Nexus config values directly without binding to a class:Nexus config keys use dot notation (
database.host). IConfiguration treats dots as part of the key name, not as path separators — so configuration["database.host"] and configuration.GetSection("database")["host"] are different lookups. Use GetSection("database")["host"] only if your key names match section-style navigation.Value type serialization
Nexus config values are JSON. The provider serializes them to strings for IConfiguration:
Standard binding (
IOptions<T>) handles strings, numbers, and booleans natively. JSON object values must be parsed manually if bound to a property.
Combining with other configuration sources
AddWestyx stacks with the other sources in the builder. The last source wins for duplicate keys — so to let local environment variables override Nexus values (useful during development), add Nexus before environment variables:
appsettings.json but lower than environment variables:
