Fturex.Client 1.0.9

dotnet add package Fturex.Client --version 1.0.9
                    
NuGet\Install-Package Fturex.Client -Version 1.0.9
                    
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="Fturex.Client" Version="1.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fturex.Client" Version="1.0.9" />
                    
Directory.Packages.props
<PackageReference Include="Fturex.Client" />
                    
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 Fturex.Client --version 1.0.9
                    
#r "nuget: Fturex.Client, 1.0.9"
                    
#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 Fturex.Client@1.0.9
                    
#: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=Fturex.Client&version=1.0.9
                    
Install as a Cake Addin
#tool nuget:?package=Fturex.Client&version=1.0.9
                    
Install as a Cake Tool

Fturex.Client — .NET SDK

Official .NET SDK for the Fturex feature toggle service. Provides feature flag evaluation with automatic caching, background refresh, usage statistics, and context-based targeting.


Requirements

  • .NET 9 or .NET 10

Installation

dotnet add package Fturex.Client

For OpenTelemetry support, also install the companion package:

dotnet add package Fturex.OpenTelemetry

Quick start

Standalone (console apps, workers, etc.)

var client = new FtureXClient(new FtureXConfiguration
{
    AppKey  = "your-api-key",
    BaseUrl = "https://your-api.com"
});

if (await client.IsEnabled("my-feature"))
{
    // feature is on
}

client.Dispose();

ASP.NET Core (DI)

// Program.cs
builder.Services.AddFtureX(new FtureXConfiguration
{
    AppKey  = builder.Configuration["FtureX:AppKey"],
    BaseUrl = builder.Configuration["FtureX:BaseUrl"]
});

// Inject IFtureX wherever you need it
public class MyController(IFtureX features)
{
    public async Task<IActionResult> Index()
    {
        if (await features.IsEnabled("my-feature"))
        {
            // feature is on
        }
        return View();
    }
}

Context-based targeting

Evaluate features against arbitrary context properties (user, role, tenant, etc.).

var context = new Dictionary<string, string>
{
    { "userId", "user-123" },
    { "role",   "admin" }
};

await client.IsEnabled("beta-feature", context);

Extension method shortcuts:

using Fturex.Extensions;

await client.IsEnabledForUser("beta-feature", "user-123");
await client.IsEnabledForRole("beta-feature", "admin");
await client.IsEnabledForTenant("beta-feature", "tenant-abc");

// Arbitrary key/value pairs
await client.IsEnabledWithContext("beta-feature", ("plan", "pro"), ("region", "eu"));

Configuration — FtureXConfiguration

Property Type Default Description
BaseUrl string required API base URL
AppKey string required API authentication key
SendStatistics bool true Include usage statistics in each refresh call
UseCache bool true Enable in-memory caching
CacheRefreshIntervalSeconds int 30 How often the manifest is refreshed (and stats sent)
EnableFilePersistence bool false Persist cache to disk across restarts
CacheFilePath string feature-manifest.json File path for disk persistence

Caching behaviour

The SDK fetches a full feature manifest from the server and evaluates flags locally. Context properties are matched client-side against the manifest on every call — no separate context cache.

Feature type Caching Refresh
All features Indefinite in-memory (+ optional disk) Background refresh on interval

Statistics

Usage statistics (hit counts, enabled/disabled counts, last-accessed timestamps) are tracked locally and automatically included in each POST /feature/refresh call when SendStatistics is true. No manual wiring required.


Hooks

Register hooks to observe every flag evaluation — useful for custom logging, analytics, or telemetry.

using Fturex.Hooks;

public class MyLoggingHook : IFtureXHook
{
    public Task AfterAsync(HookContext context, EvaluationResult result)
    {
        Console.WriteLine($"{context.FlagKey} => {result.Value}");
        return Task.CompletedTask;
    }
}

// Standalone
client.AddHook(new MyLoggingHook());

// DI — resolve after AddFtureX
var ftureX = (FtureXClient)app.Services.GetRequiredService<IFtureX>();
ftureX.AddHook(new MyLoggingHook());

IFtureXHook has three optional methods:

Method When called
BeforeAsync(HookContext) Before each evaluation
AfterAsync(HookContext, EvaluationResult) After a successful evaluation
ErrorAsync(HookContext, Exception) When evaluation throws

OpenTelemetry

Register in Program.cs:

builder.Services.AddFtureX(config);
builder.Services.AddFtureXOpenTelemetry(options =>
{
    options.AddSpanEvents = true;   // add span events to the active span (default: true)
    options.AddMetrics    = true;   // emit evaluation counters as OTel metrics (default: true)
    options.RecordFlagValue = false; // include flag value in span attributes (default: false)
    options.SetId = "production";   // optional flag-set identifier
});

builder.Services.AddOpenTelemetry()
    .WithTracing(t => t.AddSource(FtureXOtelExtensions.ActivitySourceName))
    .WithMetrics(m => m.AddMeter(FtureXOtelExtensions.MeterName));

API compatibility

Endpoint Purpose
POST /feature/refresh Fetch manifest and report statistics in one call

Authentication uses the X-Client-Key request header.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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
1.0.9 98 4/29/2026
1.0.8 98 4/20/2026
1.0.6 118 3/29/2026
1.0.5 107 3/24/2026
1.0.4 108 3/24/2026
1.0.3 117 3/24/2026 1.0.3 is deprecated because it is no longer maintained.
1.0.2 115 3/22/2026 1.0.2 is deprecated because it is no longer maintained.
1.0.1 115 3/22/2026 1.0.1 is deprecated because it is no longer maintained.