Skip to main content

Feature filters reference

Custom Rollout rules in the Toggly dashboard are stored as filters on each feature definition. The Definitions worker evaluates these filters for client-side SDKs; server-side SDKs evaluate the same filter names in your application process.

Served names: Definitions publish short names — Percentage, Targeting, TimeWindow — for every stack. Use those names in the dashboard and in every SDK. The .NET FeatureProvider maps them to Microsoft.FeatureManagement registration names (Microsoft.Percentage, Microsoft.Targeting, Microsoft.TimeWindow) when evaluating locally.

For a per-SDK map of worker vs local vs fail-closed support, see the SDK × filter matrix.

Combining filters​

Each feature has a requirement type:

  • Any (default): the feature is enabled if at least one filter passes.
  • All: every filter must pass.

Context requirements​

FilterClient SDK must passWorker reads automatically
Always On——
Percentageidentity—
Targetingidentity (+ groups for group rules)—
User Claimsclaims map—
Context Propertyentity on each eval / widget—
Browser Family, Browser Language, Country, Device Type, Operating System— (browser fetch)User-Agent, Accept-Language, CF-IPCountry
Time Window—Server clock

Use setContext() on client SDKs to pass identity, groups, and claims.


Always On​

Enables the feature for everyone with no additional conditions.

Parameters: none

Example (processed definition):

{ "name": "AlwaysOn", "parameters": {} }

Percentage​

Deterministic percentage rollout based on user identity (SHA-256 bucket).

Parameters:

NameTypeDescription
ValuenumberPercentage 0–100

Filter name: Percentage

Requires: identity in SDK context (anonymous users do not receive partial rollouts).


Targeting​

Target specific users and groups, with optional default rollout percentage for everyone else.

Parameters (after RavenDB index expansion):

NameDescription
Audience.Users:0..NIncluded user IDs
Audience.Groups:0..NIncluded group names
Audience.Exclusion.Users:0..NExcluded users (win over inclusion)
Audience.Exclusion.Groups:0..NExcluded groups
Audience.DefaultRolloutPercentage or PercentageRollout % for users not explicitly listed
IgnoreCasetrue by default for user/group matching

Filter name: Targeting


Time Window​

Enable the feature only between start and end datetimes (UTC).

Parameters:

NameType
StartISO 8601 datetime (optional)
EndISO 8601 datetime (optional)

Filter name: TimeWindow


Browser Family​

Match the browser family parsed from the request User-Agent.

Parameters:

NameType
BrowserFamily:0..NBrowser name substring (e.g. Chrome)
PercentageSegment rollout gate (0–100)

Browser Language​

Match languages from the Accept-Language header.

Parameters:

NameType
BrowserLanguage:0..NLanguage code substring (e.g. en)
PercentageSegment rollout gate

Country​

Match the visitor country from Cloudflare CF-IPCountry (exact match, case-insensitive).

Parameters:

NameType
Country:0..NISO 3166-1 alpha-2 code (e.g. US)
PercentageSegment rollout gate

Device Type​

Match device model/family parsed from User-Agent (e.g. iPhone).

Parameters:

NameType
DeviceType:0..NDevice substring
PercentageSegment rollout gate

Operating System​

Match OS family parsed from User-Agent (e.g. Windows, iOS).

Parameters:

NameType
OperatingSystem:0..NOS substring
PercentageSegment rollout gate

Filter name: OS


User Claims​

Match a claim type and value supplied by the client SDK (same semantics as .NET HasClaim(type, value) on the server).

Parameters:

NameType
ClaimClaim type / name
ValueExpected claim value
PercentageSegment rollout gate

Requires: claims in SDK context, e.g. claims: { role: 'admin' } → query ?claim.role=admin (maximum 20 claim types per request).

Trust model (client-side apps)

On client-side SDKs, identity, groups, and claims are sent as query parameters on evaluated-signed. The browser (or any client) can change those values before the request reaches the worker. User Claims on the edge are for rollout targeting and experiments, not for authorization.

  • Do not use User Claims alone to gate access to sensitive APIs, admin actions, or protected data.
  • Enforce security on your backend with the .NET SDK (or your own server), where claims come from authenticated sessions — not from client-supplied query strings.
  • Prefer opaque user IDs for identity rather than email addresses or other direct identifiers (see Evaluated-signed security).

Context Property​

Match a property on the entity instance passed into this evaluation (not the signed-in user). Percentage / rollout never uses entity keys. Context kind lives on the feature (contextKind), not on this filter.

Parameters:

NameTypeDescription
PropertystringAttribute name on the entity (e.g. Color)
OperatorstringComparison: eq, neq, gt, gte, lt, lte, in, contains
ValuestringExpected value(s); for in, a comma-separated list
ValueTypestringstring, number, datetime, boolean, or string[]

Filter name: ContextProperty

Requires: entity context on this check or widget. Client SDKs map objects with local registerContext. Server SDKs register kinds at startup (PUT sdk/{appKey}/contexts, opt-out supported). Clients never register schemas.

If the feature value is an EntityGate and you omit entity context, or the kind is unknown, evaluation fails closed (off).

setContext() / identity remains user context for Percentage, Targeting, and User Claims. See Entity & page context.