Using FeatureFlags.app: Because You Deserve an Easy Life
Using FeatureFlags.app
Managing feature flags from a central server is more powerful than hardcoding values in appsettings.json. If you want a flag management server ready to go, featureflags.app is free to try. The FeatureFlags.app client library connects your application, so you can update flags without touching configuration files or redeploying your app.
Installation
Add the Acmi.FeatureFlags.Client NuGet package to your project:
dotnet add package Acmi.FeatureFlags.Client
Then register it in your application. The client provides an extension method on IHostApplicationBuilder. In Program.cs:
using Acmi.FeatureFlags.Client;
...
builder.AddFeatureFlags();
That registers the necessary services, including IFeatureManager, in your dependency injection container.
Configuration
The client needs to know where to find the feature flag API, and how to authenticate. Add the endpoint URL and API key to your appsettings.json:
{
"FeatureFlags": {
"ApiBaseEndpoint": "https://featureflags.app/api/",
"ApiKey": "[from secrets]",
"CacheExpirationInMinutes": 15
}
}
The client fetches flag definitions from that endpoint and caches them locally.
Checking Flags
Inject IFeatureManager wherever you need to check flags:
public class ProductController : Controller
{
private readonly IFeatureManager _featureManager;
public ProductController(IFeatureManager featureManager)
{
_featureManager = featureManager;
}
public async Task<IActionResult> Index()
{
if (await _featureManager.IsEnabledAsync("NewProductPage"))
{
return View("NewProductPage");
}
return View("ProductPage");
}
}
The interface is the same as Microsoft.FeatureManagement, so switching between local configuration and remote management doesn’t require changing your flag-checking code. This example shows IFeatureManager, but feature management attributes and tag helpers work out of the box too.
Clearing the Cache
The client caches flag values to avoid hammering the remote API on every request. If you update a flag on the server and want your application to pick up the change immediately, inject IFeatureFlagClient and call ClearCache() — or just wait for the configured expiration to kick in.
In a development environment, you may want to set a short cache duration so changes are picked up quickly. In production, a longer cache keeps things snappy and reduces load on the flag server.
Why Remote Flags?
Storing flag values in appsettings.json works for simple scenarios, but it has limits. Changing a flag requires a configuration update and often a restart. There’s no audit trail. There’s no UI. Multiple services can’t share flag definitions easily.
A central flag management server solves all of that. You update a flag in one place, and every connected application picks it up within the cache window. You can see the history of changes, who made them, and when. Non-developers can manage flags through a web UI without touching code or config files. The Acmi.FeatureFlags.Client library is the bridge between your application and that centralized control.
For more, see the FeatureFlags.app README or just ask your favorite AI.
Configure once. Control everywhere. Sleep slightly better.