WestyxNexus.OpenFeature package provides NexusProvider, an OpenFeature-compliant FeatureProvider that wraps an existing NexusClient. Config resolutions are served from the client’s local in-memory cache; a boolean evaluation is resolved per user through the AB Testing add-on when the EvaluationContext carries a targeting key.
Installation
WestyxNexus.OpenFeature brings in the core WestyxNexus package. It supports the OpenFeature .NET SDK 2.x (OpenFeature 2.0 or later, below 3.0).
Quick start
Value mapping
Flags vs configs: Boolean resolution reads the feature flag cache, or evaluates per user when the context carries a targeting key. All other types use
GetConfig (the config cache).
Error handling
The provider returns a
ResolutionDetails<T> with the appropriate error type set rather than throwing. The one exception is cancellation: an evaluation whose CancellationToken is cancelled while a targeted lookup is in flight ends with OperationCanceledException.
Per-user targeting
When theEvaluationContext carries a targeting key, a boolean evaluation is resolved for that user
through the AB Testing add-on: the flag’s rollout percentage and cohort rules are applied to that
identity. Without a targeting key the synced snapshot is read, as it always has been.
age.ToString(CultureInfo.InvariantCulture) rather than age - and you know exactly what the
cohort rule is matched against.
Only boolean evaluation is targeted. String, double, integer and structure values come from configs,
and a config has no per-user dimension in Nexus.
Requests and caching
A targeted evaluation is a network call where the snapshot path is a dictionary lookup. Two things keep that affordable, and neither needs configuring: one request serves every flag the snapshot knows for that user, so reading five flags while handling a request costs one round trip; and results are memoised per user and flag for 30 seconds, with concurrent evaluations for the same user coalescing into a single request.TargetingTtl
would turn every evaluation into a network call.
Reason codes
A failed targeted request never surfaces as an error. The OpenFeature SDK answers an error resolution
by returning the caller’s default, so a flag that is genuinely on would evaluate off because of one
failed request; the snapshot value with a
STALE reason is the honest answer and the better one. A
project without the AB Testing add-on gets Static from the snapshot, and the provider stops asking
for five minutes before trying again. While the environment is switched off in the console
(NexusEnvironmentDisabledException) the answer is STALE, and the provider stops calling
EvaluateABAsync - for any user - for the same AddonSuppression window, with one warning (event
203); any success clears it.
SPLIT is never reported: the endpoint returns booleans only, so a rollout bucket and a cohort match
are indistinguishable here, and TargetingMatch covers both.
Variant carries the string form of the resolved value for boolean, string, double and integer
resolutions - "true" / "false" for a boolean, lowercase, which is the same spelling every SDK in
the Westyx Nexus suite uses. A structure resolution has no variant: a composite value has no short
semantic identifier.
ASP.NET Core DI example
builder.AddWestyxNexus needs WestyxNexus.Extensions.Configuration. It runs the first sync while
the builder runs, so the client is ready when the provider is registered, and the stream is started
for you - see Getting started.
Inject IFeatureClient into your services:
Live updates
Whennexus.ConnectStream() is active, the client’s cache is updated within milliseconds of a remote flag change via SSE. OpenFeature evaluations pick up the new value on the next call because the provider reads directly from the live cache.