BarakoCMS.FeatureFlags
4.6.0
See the version list below for details.
dotnet add package BarakoCMS.FeatureFlags --version 4.6.0
NuGet\Install-Package BarakoCMS.FeatureFlags -Version 4.6.0
<PackageReference Include="BarakoCMS.FeatureFlags" Version="4.6.0" />
<PackageVersion Include="BarakoCMS.FeatureFlags" Version="4.6.0" />
<PackageReference Include="BarakoCMS.FeatureFlags" />
paket add BarakoCMS.FeatureFlags --version 4.6.0
#r "nuget: BarakoCMS.FeatureFlags, 4.6.0"
#:package BarakoCMS.FeatureFlags@4.6.0
#addin nuget:?package=BarakoCMS.FeatureFlags&version=4.6.0
#tool nuget:?package=BarakoCMS.FeatureFlags&version=4.6.0
<div align="center"> <img src="https://raw.githubusercontent.com/BaryoDev/barakoCMS/master/assets/icon.png" width="96" height="96" alt="BarakoCMS.FeatureFlags logo" /> <h1>BarakoCMS.FeatureFlags</h1> <p><em>Ship it dark, turn it on for some people, then everyone.</em></p> </div>
Create a flag, toggle it, and target it — by tenant, by user, or by percentage rollout. Flags are global with per-tenant targeting, and every decision is made server-side.
Enable it
dotnet add package BarakoCMS.FeatureFlags
builder.Services.AddBarakoCMS(builder.Configuration);
var app = builder.Build();
app.UseBarakoCMS();
The package reference plus a restart is the install. AddBarakoCMS finds every module in the
application's dependency context, and BarakoCMS:Modules:Enabled decides which of them run
(BarakoCMS__Modules__Enabled=FeatureFlags). Unset, every referenced module runs and the API logs
one warning saying so. To name it by hand instead, put
modules.Add(new BarakoCMS.FeatureFlags.FeatureFlagsModule())
in the AddBarakoCMS callback; discovery skips a type the host already added. See MODULES.md in
the repository.
Endpoints
| Method & path | Purpose | Access |
|---|---|---|
GET /api/feature-flags |
Flags as evaluated for the caller (superseded by OFREP, below) | Anyone (flags limited by visibility level) |
POST /ofrep/v1/evaluate/flags[/{key}] |
OpenFeature evaluation (see below) | Anyone (flags limited by visibility level) |
GET /api/feature-flags/admin |
Every flag with its targeting rules | Admin / SuperAdmin held as a global role |
POST /api/feature-flags/admin |
Create or update a flag | Admin / SuperAdmin held as a global role |
POST /api/feature-flags/admin/{key}/toggle |
Flip a flag | Admin / SuperAdmin held as a global role |
DELETE /api/feature-flags/admin/{key} |
Remove a flag | Admin / SuperAdmin held as a global role |
Flags are global and their targeting names tenants, so the admin routes answer 403 to an Admin whose role comes only from a tenant membership.
GET /api/feature-flags returns decisions, not rules — the client never learns why it was included,
and cannot flip itself in by editing a response.
OpenFeature (OFREP)
The module speaks the OpenFeature Remote Evaluation Protocol,
so an OpenFeature SDK with its stock OFREP provider reads these flags with no client of ours.
Give the provider the API's origin, https://your-api, as its base URL. Providers append the
protocol's own path to the host, which is where the routes are:
| Method & path | Purpose | Access |
|---|---|---|
POST /ofrep/v1/evaluate/flags/{key} |
One flag, evaluated for the caller | Anyone (flags limited by visibility level) |
POST /ofrep/v1/evaluate/flags |
Every flag the caller may see, with an ETag; a matching If-None-Match answers 304 |
Anyone (flags limited by visibility level) |
The subset covered, stated rather than implied:
- Boolean flags only.
valueistrueorfalse,variantisonoroff. A string, number or object request for a key answers with the boolean, which an SDK reports as a type mismatch. - Reason: always
STATIC. The protocol's other reasons (TARGETING_MATCH,SPLIT,DISABLED) would say why a caller got its value, and this module returns decisions, not rules. - Errors:
FLAG_NOT_FOUNDwith 404, for a key that does not exist and, to an anonymous caller, for a private one, so the key is not disclosed. - Context: only
targetingKeyis read, only from an anonymous caller, and only to choose the rollout bucket. The tenant and the user always come from the request. A context naming another tenant or user changes nothing, so it cannot be used to read someone else's flags. - Not covered: context-based targeting rules, flag metadata, and the provider-side cache configuration endpoint.
GET /api/feature-flags keeps answering through 5.x. It is superseded by the routes above, and
every response says so with Link: </ofrep/v1/evaluate/flags>; rel="successor-version".
Public flags
A flag has a visibility level: Public (anyone), SignedIn (any signed-in caller) or Admin (callers
who can manage feature flags). GET /api/feature-flags and the OFREP routes return only the flags the
caller's level allows. Everything else is absent from the response, not returned as false, and an
OFREP single read of a flag the caller cannot see answers exactly like a missing key.
POST /api/feature-flags/admin
{ "key": "new-checkout", "enabled": true, "visibility": "Public" }
isPublic still works: true means Public, false keeps the flag's current level (SignedIn if it was
Public). A flag saved with neither field is Admin only. Flags stored before levels existed read as
Public when isPublic was true and SignedIn otherwise, so an upgrade changes what nobody sees.
The admin list and save response return both visibility and isPublic.
A flag is not access control
Use a flag to decide whether a feature is available. Keep using roles to decide whether a caller is allowed. A flag that hides an admin button still leaves the endpoint reachable.
Part of barakoCMS
This is an optional module for barakoCMS, an open-source
headless CMS for .NET 10. Every module is published under the barakocms-module tag, so a single
search on nuget.org returns the whole set.
Contributions are welcome — including a module icon or other design work. See CONTRIBUTING.md.
Licensed under MIT.
If barakoCMS is useful to you, a star on the repository helps other people find 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
- AspNetCore.HealthChecks.Npgsql (>= 9.0.0)
- AspNetCore.HealthChecks.System (>= 9.0.0)
- BarakoCMS (>= 5.3.0)
- BarakoCMS.Abstractions (>= 5.3.0)
- BCrypt.Net-Next (>= 4.2.0)
- Carom (>= 2.0.1)
- Carom.Extensions (>= 2.0.1)
- Cronos (>= 0.11.1)
- FastEndpoints (>= 8.3.0)
- FastEndpoints.Security (>= 8.3.0)
- FastEndpoints.Swagger (>= 8.3.0)
- IdentityModel (>= 7.0.0)
- JasperFx (>= 2.90.2)
- KubernetesClient (>= 18.0.13)
- Markdig (>= 1.4.1)
- Marten (>= 9.50.3)
- Microsoft.Extensions.DependencyModel (>= 10.0.13)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.23.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.20.0)
- OpenTelemetry.Extensions.Hosting (>= 1.20.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.20.0)
- OpenTelemetry.Instrumentation.Http (>= 1.20.0)
- Otp.NET (>= 1.4.1)
- prometheus-net.AspNetCore (>= 8.2.1)
- Serilog.AspNetCore (>= 10.0.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.File (>= 7.0.0)
- System.IdentityModel.Tokens.Jwt (>= 8.23.0)
- WolverineFx.Marten (>= 6.51.1)
- WolverineFx.RuntimeCompilation (>= 6.51.1)
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 |
|---|---|---|
| 4.6.6 | 0 | 11/25/2026 |
| 4.6.5 | 64 | 11/22/2026 |
| 4.6.4 | 72 | 11/18/2026 |
| 4.6.3 | 90 | 11/16/2026 |
| 4.6.2 | 70 | 11/6/2026 |
| 4.6.1 | 133 | 10/27/2026 |
| 4.6.0 | 101 | 10/25/2026 |
| 4.5.0 | 105 | 10/23/2026 |
| 4.4.0 | 113 | 10/14/2026 |
| 4.3.2 | 123 | 10/4/2026 |
| 4.3.1 | 117 | 9/29/2026 |
| 4.3.0 | 119 | 9/21/2026 |
| 4.0.0 | 139 | 9/7/2026 |
| 0.2.0 | 139 | 8/20/2026 |
| 0.1.3 | 129 | 8/15/2026 |
| 0.1.2 | 210 | 8/3/2026 |
| 0.1.1 | 141 | 7/21/2026 |
| 0.1.0 | 93 | 7/17/2026 |