Featureflip.Client
2.14.0
See the version list below for details.
dotnet add package Featureflip.Client --version 2.14.0
NuGet\Install-Package Featureflip.Client -Version 2.14.0
<PackageReference Include="Featureflip.Client" Version="2.14.0" />
<PackageVersion Include="Featureflip.Client" Version="2.14.0" />
<PackageReference Include="Featureflip.Client" />
paket add Featureflip.Client --version 2.14.0
#r "nuget: Featureflip.Client, 2.14.0"
#:package Featureflip.Client@2.14.0
#addin nuget:?package=Featureflip.Client&version=2.14.0
#tool nuget:?package=Featureflip.Client&version=2.14.0
Featureflip C# SDK
C# SDK for Featureflip - evaluate feature flags locally with near-zero latency.
Installation
dotnet add package Featureflip.Client
Quick Start
using Featureflip.Client;
var client = FeatureflipClient.Get("your-sdk-key");
> **Lifetime:** The client is designed to be used as a singleton. Calling `FeatureflipClient.Get()` multiple times with the same SDK key returns handles sharing one underlying client — you cannot accidentally open duplicate streaming connections. For dependency injection, `AddFeatureflip` registers it as a singleton by default.
var enabled = client.BoolVariation("my-feature",
new EvaluationContext { UserId = "user-123" }, false);
if (enabled)
{
Console.WriteLine("Feature is enabled!");
}
client.Dispose();
Configuration
var client = FeatureflipClient.Get(
"your-sdk-key",
new FeatureFlagOptions
{
BaseUrl = "https://eval.featureflip.io", // Evaluation API URL (default)
Streaming = true, // SSE for real-time updates (default)
PollInterval = TimeSpan.FromSeconds(30), // Polling interval if streaming=false
FlushInterval = TimeSpan.FromSeconds(30), // Event flush interval
FlushBatchSize = 100, // Events per batch
InitTimeout = TimeSpan.FromSeconds(10), // Max wait for initialization
ConnectTimeout = TimeSpan.FromSeconds(5), // HTTP connection timeout
ReadTimeout = TimeSpan.FromSeconds(10), // HTTP read timeout
WaitForInitialization = false, // Block constructor until ready
StartOffline = false, // Continue even if init fails
SnapshotStore = null, // e.g. new FileSnapshotStore(path): start from the last saved config
MaxSnapshotAge = TimeSpan.FromHours(24), // Oldest snapshot to start from
}
);
The SDK key can also be set via the FEATUREFLIP_SDK_KEY environment variable.
Set SnapshotStore to let a new process start from its last known configuration when the Evaluation API is unreachable at startup. client.StartupInfo reports whether the data came from a live fetch or a snapshot. See the C# SDK reference.
Evaluation
var context = new EvaluationContext { UserId = "123" };
// Boolean flag
bool enabled = client.BoolVariation("feature-key", context, false);
// String flag
string tier = client.StringVariation("pricing-tier", context, "free");
// Integer flag
int limit = client.IntVariation("rate-limit", context, 100);
// Double flag
double ratio = client.DoubleVariation("rollout-ratio", context, 0.5);
// JSON flag
var config = client.JsonVariation("ui-config", context, new UiConfig { Theme = "light" });
// Generic
var value = client.Variation("feature-key", context, defaultValue);
Detailed Evaluation
var detail = client.VariationDetail("feature-key",
new EvaluationContext { UserId = "123" }, false);
Console.WriteLine(detail.Value); // The evaluated value
Console.WriteLine(detail.Reason); // RuleMatch, Fallthrough, FlagDisabled, etc.
Console.WriteLine(detail.RuleId); // Rule ID if reason is RuleMatch
Console.WriteLine(detail.ErrorMessage); // Error details if reason is Error
Event Flushing
// Force flush pending events
client.Flush();
// Or async
await client.FlushAsync();
Dependency Injection
// In Startup.cs or Program.cs
services.AddFeatureflipClient("your-sdk-key");
// Inject via constructor
public class MyService
{
private readonly IFeatureflipClient _client;
public MyService(IFeatureflipClient client)
{
_client = client;
}
}
Testing
The IFeatureflipClient interface makes mocking straightforward:
var mock = new Mock<IFeatureflipClient>();
mock.Setup(c => c.BoolVariation("my-feature", It.IsAny<EvaluationContext>(), false))
.Returns(true);
Features
- Local evaluation - Near-zero latency after initialization
- Real-time updates - SSE streaming with automatic polling fallback
- Event tracking - Automatic batching and background flushing
- DI support -
AddFeatureflipClient()extension method - Interface-based -
IFeatureflipClientfor easy mocking - Multi-target - Supports .NET 8.0 and .NET Standard 2.0
Requirements
- .NET 8.0+ or .NET Standard 2.0 compatible runtime
License
Apache-2.0
| 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 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. |
| .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
- Microsoft.Bcl.HashCode (>= 1.1.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- System.Collections.Immutable (>= 8.0.0)
- System.Net.Http.Json (>= 8.0.1)
- System.Text.Json (>= 8.0.6)
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Featureflip.Client:
| Package | Downloads |
|---|---|
|
Featureflip.Client.Extensions.DependencyInjection
Dependency injection extensions for Featureflip.Client |
|
|
Featureflip.OpenFeature
OpenFeature provider for Featureflip (.NET server SDK) |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.14.1 | 131 | 11/16/2026 |
| 2.14.0 | 390 | 11/8/2026 |
| 2.13.0 | 192 | 10/30/2026 |
| 2.12.1 | 192 | 10/29/2026 |
| 2.12.0 | 274 | 10/27/2026 |
| 2.11.0 | 154 | 10/22/2026 |
| 2.10.0 | 220 | 10/21/2026 |
| 2.9.0 | 1,460 | 8/26/2026 |
| 2.8.1 | 162 | 8/25/2026 |
| 2.7.1 | 248 | 8/23/2026 |
| 2.7.0 | 404 | 8/20/2026 |
| 2.6.1 | 189 | 8/5/2026 |
| 2.6.0 | 387 | 7/31/2026 |
| 2.5.0 | 199 | 7/29/2026 |
| 2.4.0 | 327 | 7/14/2026 |
| 2.3.0 | 187 | 7/13/2026 |
| 2.2.1 | 452 | 6/24/2026 |
| 2.2.0 | 201 | 6/19/2026 |
| 2.1.0 | 193 | 5/27/2026 |
| 2.0.0 | 191 | 4/7/2026 |