OpenFeature.Providers.Unleash
0.1.1
Prefix Reserved
dotnet add package OpenFeature.Providers.Unleash --version 0.1.1
NuGet\Install-Package OpenFeature.Providers.Unleash -Version 0.1.1
<PackageReference Include="OpenFeature.Providers.Unleash" Version="0.1.1" />
<PackageVersion Include="OpenFeature.Providers.Unleash" Version="0.1.1" />
<PackageReference Include="OpenFeature.Providers.Unleash" />
paket add OpenFeature.Providers.Unleash --version 0.1.1
#r "nuget: OpenFeature.Providers.Unleash, 0.1.1"
#:package OpenFeature.Providers.Unleash@0.1.1
#addin nuget:?package=OpenFeature.Providers.Unleash&version=0.1.1
#tool nuget:?package=OpenFeature.Providers.Unleash&version=0.1.1
Unleash .NET Provider
The Unleash provider allows you to use Unleash with the OpenFeature .NET SDK.
.Net SDK usage
Requirements
- open-feature/dotnet-sdk v2.x
- Unleash .NET SDK v6.x
Install dependencies
The first thing we will do is install the OpenFeature SDK and the Unleash Feature Flag provider.
.NET Cli
dotnet add package OpenFeature.Providers.Unleash
Package Manager
NuGet\Install-Package OpenFeature.Providers.Unleash
Package Reference
<PackageReference Include="OpenFeature.Providers.Unleash" />
Packet cli
paket add OpenFeature.Providers.Unleash
Cake
// Install OpenFeature.Providers.Unleash as a Cake Addin
#addin nuget:?package=OpenFeature.Providers.Unleash
// Install OpenFeature.Providers.Unleash as a Cake Tool
#tool nuget:?package=OpenFeature.Providers.Unleash
Using the Unleash Provider with the OpenFeature SDK
using OpenFeature;
using OpenFeature.Providers.Unleash;
using Unleash;
var settings = new UnleashSettings
{
AppName = "my-app",
UnleashApi = new Uri("http://localhost:4242/api/"),
CustomHttpHeaders = new Dictionary<string, string>
{
{ "Authorization", "*:development.your-api-token" }
}
};
var provider = new UnleashProvider(settings);
// Set the provider for the OpenFeature SDK
await Api.Instance.SetProviderAsync(provider);
// Get an OpenFeature client
var client = Api.Instance.GetClient();
// Boolean evaluation (uses IsEnabled)
var enabled = await client.GetBooleanValueAsync("my-feature", false);
// String evaluation (uses variant payload)
var value = await client.GetStringValueAsync("my-variant-flag", "default");
// Integer evaluation (parses variant payload)
var count = await client.GetIntegerValueAsync("my-int-flag", 0);
// Double evaluation (parses variant payload)
var rate = await client.GetDoubleValueAsync("my-double-flag", 0.0);
EvaluationContext and Unleash Context relationship
The provider maps OpenFeature EvaluationContext fields to UnleashContext:
| EvaluationContext Key | Unleash Context Field |
|---|---|
TargetingKey |
UserId |
sessionId |
SessionId |
remoteAddress |
RemoteAddress |
environment |
Environment |
appName |
AppName |
currentTime |
CurrentTime |
| All other keys | Properties |
Variant payload type metadata
When evaluating variants (string, integer, double, structure), the provider exposes the Unleash payload type field (e.g., "string", "number", "json", "csv") as payload-type in the resolution details flag metadata.
Events
The provider emits ProviderConfigurationChanged events when Unleash fires TogglesUpdatedEvent (i.e., when toggle state is refreshed from the server).
Known issues and limitations
- The provider does not accept an external
IUnleashinstance because lifecycle events (ReadyEvent,ErrorEvent,TogglesUpdatedEvent) can only be subscribed during client construction.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 is compatible. 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. |
-
net10.0
- OpenFeature (>= 2.0.0 && < 3.0.0)
- Unleash.Client (>= 6.2.1 && < 7.0.0)
-
net8.0
- OpenFeature (>= 2.0.0 && < 3.0.0)
- Unleash.Client (>= 6.2.1 && < 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.1 | 48 | 6/17/2026 |