Feature Flags Module
Control feature rollouts with percentage-based targeting, user lists, and instant toggling without redeployment.
Why Use Primus Feature Flags?
Deploying features without control is risky. Primus Feature Flags provides instant toggling with targeting rules.
// Check if feature is enabled
if (flags.IsEnabled("NewDashboard"))
{
return GetNewDashboard();
}
Supported Providers
JSON/Config
Store flags in appsettings.json for simplicity.
LocalSimple
Azure App Config
Centralized feature management with Azure.
AzureCentralized
Result Object (IFeatureFlagService)
| Method | Returns | Description |
|---|---|---|
IsEnabled(name) | bool | Check if flag is on |
IsEnabledForUser(name, userId) | bool | Check with user context |
GetAllFlagsAsync() | Task<Dictionary> | Get all flag states |
Flag Configuration
| Property | Type | Description |
|---|---|---|
Enabled | bool | Global toggle |
RolloutPercentage | int? | Percentage of users (0-100) |
EnabledForUsers | List<string>? | Specific user IDs |
EnabledForTenants | List<string>? | Specific tenant IDs |
Examples
Quick Install
dotnet add package PrimusSaaS.FeatureFlags
Next Steps
| Want to... | See Guide |
|---|---|
| Get started | Quick Start |
| Full reference | Feature Flags |