ConfigDirector.OpenFeature.ServerProvider
1.0.1
See the version list below for details.
dotnet add package ConfigDirector.OpenFeature.ServerProvider --version 1.0.1
NuGet\Install-Package ConfigDirector.OpenFeature.ServerProvider -Version 1.0.1
<PackageReference Include="ConfigDirector.OpenFeature.ServerProvider" Version="1.0.1" />
<PackageVersion Include="ConfigDirector.OpenFeature.ServerProvider" Version="1.0.1" />
<PackageReference Include="ConfigDirector.OpenFeature.ServerProvider" />
paket add ConfigDirector.OpenFeature.ServerProvider --version 1.0.1
#r "nuget: ConfigDirector.OpenFeature.ServerProvider, 1.0.1"
#:package ConfigDirector.OpenFeature.ServerProvider@1.0.1
#addin nuget:?package=ConfigDirector.OpenFeature.ServerProvider&version=1.0.1
#tool nuget:?package=ConfigDirector.OpenFeature.ServerProvider&version=1.0.1
ConfigDirector OpenFeature .NET Server Provider
OpenFeature server provider for
ConfigDirector, published to NuGet as
ConfigDirector.OpenFeature.ServerProvider. It wraps the
ConfigDirector .NET server SDK
and targets netstandard2.0 and net8.0.
Installation
dotnet add package ConfigDirector.OpenFeature.ServerProvider
The OpenFeature .NET SDK (OpenFeature) and the ConfigDirector .NET server SDK come with it as
dependencies.
Retrieve a value
using ConfigDirector.OpenFeature;
using OpenFeature;
// The server SDK key is a secret. Do not commit it to your source code.
await Api.Instance.SetProviderAsync(new ConfigDirectorProvider("YOUR-SERVER-SDK-KEY"));
var client = Api.Instance.GetClient();
var newCheckout = await client.GetBooleanValueAsync("new-checkout", false);
The provider owns its ConfigDirector client: it connects when OpenFeature initializes the provider, and closes when OpenFeature shuts it down. Targeting rules are evaluated locally, so an evaluation makes no network calls.
Settings
The second constructor argument takes the same ConfigDirectorClientOptions a
ConfigDirectorClient accepts:
new ConfigDirectorProvider("YOUR-SERVER-SDK-KEY", new ConfigDirectorClientOptions
{
Metadata = new Metadata { AppName = "checkout", AppVersion = "1.2.3" },
LoggerFactory = loggerFactory,
Connection = { Mode = ConnectionMode.Polling },
});
The evaluation context
An OpenFeature evaluation context maps onto the ConfigDirector context that targeting rules are evaluated against:
| OpenFeature | ConfigDirector |
|---|---|
targeting key, or failing that an id attribute |
Id |
name |
Name |
traits, a structure |
Traits |
anonymous, a boolean |
Anonymous |
var context = EvaluationContext.Builder()
.SetTargetingKey("user-1")
.Set("name", "Ada Lovelace")
.Set("traits", Structure.Builder().Set("plan", "pro").Build())
.Build();
var newCheckout = await client.GetBooleanValueAsync("new-checkout", false, context);
Resolution details
A match reports the reason TARGETING_MATCH with the ConfigDirector value id as the variant. A
config the server does not know reports FLAG_NOT_FOUND, a value that does not match the requested
type reports TYPE_MISMATCH, and an evaluation made before the first config state has arrived
reports PROVIDER_NOT_READY. In every error case the default you passed is returned.
Events
The provider emits PROVIDER_CONFIGURATION_CHANGED with the keys each update carried. If the first
config state does not arrive within the configured timeout, initialization still completes and the
provider emits PROVIDER_READY once it does.
Dependency injection
With the OpenFeature.Hosting package, register the provider through the OpenFeature builder:
builder.Services.AddOpenFeature(openFeature =>
openFeature.AddProvider(_ => new ConfigDirectorProvider(serverSdkKey)));
The hosted lifecycle that AddOpenFeature registers initializes the provider as the host starts,
which connects the client before the server listens, and shuts it down as the host stops. Take
IFeatureClient, and Api if you need it, from the container: AddOpenFeature drives its own
Api instance, so the static Api.Instance is not the one your provider is registered with.
Documentation
Refer to the official documentation for the OpenFeature .NET provider.
What changed in each release is in the changelog.
Getting Help
Reach out to us via https://www.configdirector.com/support
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- ConfigDirector.ServerSdk (>= 1.3.0)
- OpenFeature (>= 2.14.1)
-
net8.0
- ConfigDirector.ServerSdk (>= 1.3.0)
- OpenFeature (>= 2.14.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.