Skip to main content

Feature Flags Module

Try in Playground

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


Result Object (IFeatureFlagService)

MethodReturnsDescription
IsEnabled(name)boolCheck if flag is on
IsEnabledForUser(name, userId)boolCheck with user context
GetAllFlagsAsync()Task<Dictionary>Get all flag states

Flag Configuration

PropertyTypeDescription
EnabledboolGlobal toggle
RolloutPercentageint?Percentage of users (0-100)
EnabledForUsersList<string>?Specific user IDs
EnabledForTenantsList<string>?Specific tenant IDs

Examples


Quick Install

dotnet add package PrimusSaaS.FeatureFlags

Next Steps

Want to...See Guide
Get startedQuick Start
Full referenceFeature Flags