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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenFeature.Providers.Unleash" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenFeature.Providers.Unleash" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="OpenFeature.Providers.Unleash" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenFeature.Providers.Unleash --version 0.1.1
                    
#r "nuget: OpenFeature.Providers.Unleash, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpenFeature.Providers.Unleash@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenFeature.Providers.Unleash&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=OpenFeature.Providers.Unleash&version=0.1.1
                    
Install as a Cake Tool

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 IUnleash instance because lifecycle events (ReadyEvent, ErrorEvent, TogglesUpdatedEvent) can only be subscribed during client construction.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 59 6/17/2026