FeaturePilot.Client
1.0.1
dotnet add package FeaturePilot.Client --version 1.0.1
NuGet\Install-Package FeaturePilot.Client -Version 1.0.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="FeaturePilot.Client" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FeaturePilot.Client" Version="1.0.1" />
<PackageReference Include="FeaturePilot.Client" />
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 FeaturePilot.Client --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FeaturePilot.Client, 1.0.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 FeaturePilot.Client@1.0.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=FeaturePilot.Client&version=1.0.1
#tool nuget:?package=FeaturePilot.Client&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FeaturePilot.Client
Official .NET SDK for FeaturePilot — feature flag evaluation, event tracking, and real-time SSE streaming.
Installation
dotnet add package FeaturePilot.Client
Quick Start
// Program.cs
builder.Services.AddFeaturePilot(options =>
{
options.ApiKey = builder.Configuration["FeaturePilot:ApiKey"]!;
options.EnableStreaming = true; // real-time cache invalidation via SSE
});
// Any controller or service
public class CheckoutController(IFeaturePilotClient fp) : ControllerBase
{
[HttpGet("checkout")]
public async Task<IActionResult> Get(string userId)
{
var useV2 = await fp.BoolVariationAsync("checkout-v2", userId, defaultValue: false);
return Ok(new { version = useV2 ? "v2" : "v1" });
}
}
Flag Evaluation
// Boolean
bool enabled = await fp.BoolVariationAsync("my-flag", userId, defaultValue: false);
// String
string theme = await fp.StringVariationAsync("ui-theme", userId, defaultValue: "light");
// Number
double discount = await fp.NumberVariationAsync("discount-pct", userId, defaultValue: 0.0);
// JSON (deserialised to your type)
var config = await fp.JsonVariationAsync<MyConfig>("app-config", userId, defaultValue: new MyConfig());
// Full evaluation with reason
var result = await fp.EvaluateAsync("payment-gateway", userId);
// result.Value, result.Reason, result.VariationName, result.EnvironmentName
// Bulk evaluation (all flags in one call)
var all = await fp.EvaluateAllAsync(userId, new Dictionary<string, object>
{
["plan"] = "premium",
["country"] = "US"
});
Event Tracking
await fp.TrackAsync("purchase_completed", userId, flagKey: "checkout-v2", numericValue: 99.00);
Configuration
| Option | Default | Description |
|---|---|---|
ApiKey |
required | Server-side API key (fp_srv_...) |
ApiUrl |
https://featurepilot.io |
Base URL (override for self-hosted) |
CacheTtl |
30s | Local cache time-to-live |
HttpTimeout |
5s | Per-request HTTP timeout |
SilentFailure |
true |
Return defaults on error instead of throwing |
EnableStreaming |
false |
Real-time flag updates via SSE |
StreamReconnectDelay |
2s | Initial SSE reconnect delay |
MaxStreamReconnectDelay |
60s | Max backoff cap |
Requirements
- .NET 6.0, 7.0, or 8.0
- ASP.NET Core (for DI registration)
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- System.Text.Json (>= 8.0.5)
-
net7.0
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- System.Text.Json (>= 8.0.5)
-
net8.0
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.