FeatureFlags.Client
1.0.0
See the version list below for details.
dotnet add package FeatureFlags.Client --version 1.0.0
NuGet\Install-Package FeatureFlags.Client -Version 1.0.0
<PackageReference Include="FeatureFlags.Client" Version="1.0.0" />
<PackageVersion Include="FeatureFlags.Client" Version="1.0.0" />
<PackageReference Include="FeatureFlags.Client" />
paket add FeatureFlags.Client --version 1.0.0
#r "nuget: FeatureFlags.Client, 1.0.0"
#:package FeatureFlags.Client@1.0.0
#addin nuget:?package=FeatureFlags.Client&version=1.0.0
#tool nuget:?package=FeatureFlags.Client&version=1.0.0
FeatureFlags.Client
Minimal .NET client SDK for the Feature Flags Service. There is also a thin FeatureFlagsClientFactory layer to avoid creating a new HttpClient and client instance every time you want to evaluate a flag, which is the recommended way to use the client without the DependencyInjection companion package.
Evaluation (runtime)
using FeatureFlags.Client;
var http = new HttpClient();
var client = new FeatureFlagsClient(http, new FeatureFlagsClientOptions
{
BaseAddress = new Uri("https://localhost:5001/api/"),
ApiKey = "ffsk_..."
});
var result = await client.EvaluateAsync("my-flag", new EvaluationContext { UserId = "123" });
Console.WriteLine(result.Allowed);
With factory:
using FeatureFlags.Client;
var client = new FeatureFlagsClientFactory.Create(new FeatureFlagsClientOptions
{
BaseAddress = new Uri("https://localhost:5001/api/"),
ApiKey = "ffsk_..."
});
var result = await client.EvaluateAsync("my-flag", new EvaluationContext { UserId = "123" });
Console.WriteLine(result.Allowed);
DI registration
Install/use the companion package FeatureFlags.Client.DependencyInjection and register:
services.AddFeatureFlagsClient(options =>
{
options.BaseAddress = new Uri("https://localhost:5001/api/");
options.ApiKey = "ffsk_...";
options.ApiVersion = new Version(1, 0); // optional
});
This is the recommended way to use the client. You can then inject IFeatureFlagsClient wherever you need it.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Contracts (>= 1.0.0)
- Microsoft.AspNetCore.SignalR.Client (>= 10.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FeatureFlags.Client:
| Package | Downloads |
|---|---|
|
FeatureFlags.Client.DependencyInjection
Microsoft.Extensions.DependencyInjection helpers for FeatureFlags.Client. |
GitHub repositories
This package is not used by any popular GitHub repositories.