Precision Control Over Feature Access
Target users with surgical precision using contexts, attributes, and flexible rules. Deliver personalized experiences based on user properties, behavior, location, and custom business logic.
The Problem with Basic Feature Flags
Simple on/off switches aren't enough when you need to deliver personalized experiences
One-Size-Fits-All Features
Traditional feature flags treat all users the same, forcing you to choose between serving power users or beginners—never both effectively.
No User Context Awareness
Without understanding who your users are, you can't personalize their experience or test features with the right audience segments.
Hardcoded User Lists
Managing user targeting through code deployments or static configuration files is brittle, error-prone, and impossible to update quickly.
Understanding Contexts: The Foundation of Targeting
A context represents any entity you want to target—users, organizations, devices, or custom business objects. Each context carries attributes that describe its properties, enabling powerful and flexible targeting rules.
What Are Contexts?
Contexts are the entities you evaluate feature flags against. Instead of just "users," you can target organizations, API clients, devices, or any custom entity type your business needs.
Attributes: Context Properties
Attributes are key-value pairs that describe a context. Use built-in attributes like userId, email, and country, or define custom attributes like plan type, signup date, or feature usage count.
Multi-Context Targeting
Flagpool supports evaluating multiple contexts simultaneously. Target based on user properties, their organization's plan, and the device they're using—all in a single flag evaluation. This enables sophisticated targeting scenarios that match real-world business requirements.
Powerful Targeting Capabilities
Everything you need to target the right users at the right time
Flexible Rule Operators
Equals, not equals, in list, contains, starts with. Build simple or complex conditions that match your exact business logic.
Target Lists
Create reusable lists of users, organizations, or entities. Reference them across multiple flags without duplicating targeting logic.
Rule Priority & Ordering
Control evaluation order with explicit priorities. Ensure the most specific rules are evaluated first, with fallbacks for broader targeting.
Custom Attributes
Define any attribute your application needs. Target based on plan type, feature usage, signup date, or custom business properties.
How Targeting Rules Work
From context to evaluation: understanding the targeting flow
Pass Context
Your application sends context data (user, org, device) with attributes to Flagpool during flag evaluation.
Evaluate Rules
Rules are evaluated in priority order. First matching rule determines which variation the context receives.
Check Attributes
Each rule checks specific attributes (userId, email, country, custom) against conditions using operators.
Return Variation
The matched rule returns its assigned variation. If no rules match, the default variation is returned.
Target Lists: Reusable Targeting Logic
Create lists once, reference them everywhere
What Are Target Lists?
Target lists are reusable collections of values for a specific attribute. Instead of repeating the same list of user IDs or email addresses across multiple flags, create a target list and reference it wherever needed.
Centralized Management
Update a list in one place, changes apply across all flags using it
Semantic Naming
Name lists like "beta-testers" or "enterprise-customers" for clarity
Any Attribute Type
Create lists for userIds, emails, organizations, or custom attributes
Common Use Cases
Beta Testers
Maintain a list of early adopters who get access to experimental features. Add or remove users without touching flag configurations.
Internal Team
Keep a list of employee emails to test features internally before releasing to customers. Useful across dozens of flags.
Premium Customers
Target enterprise or premium plan customers with advanced features. Reference the same organization list across multiple feature flags.
Blocked Users
Maintain an exclusion list for users who shouldn't see certain features, useful for access control or abuse prevention.
Rule Operators Reference
Flexible operators for every targeting scenario
equserId equals "user123"Target a specific user, organization, or value
neqplan not equals "free"Exclude specific values, show features to all paid plans
inuserId in ["alice", "bob", "charlie"]Target multiple specific values or use with target lists
nincountry not in ["CA", "US", "MX"]Exclude specific regions or groups
containsemail contains "@company.com"Match partial strings like company domains
startsWithorganizationId starts with "ent_"Match prefixes like enterprise customer IDs
Combining Rules
Create sophisticated targeting by combining multiple rules with priority ordering. Rules are evaluated top-to-bottom—the first matching rule wins. This allows you to create specific exceptions before broader targeting.
Advanced
Master-level targeting capabilities for complex use cases
Complex Rule Combinations
Combine multiple conditions with AND/OR logic. Create sophisticated targeting rules that match your business requirements.
Multi-Environment Targeting
Define different targeting rules per environment. Test with internal users in staging, then roll out to customers in production.
Percentage Splits
Combine targeting rules with percentage rollouts. Target specific user segments, then gradually increase within that segment.
Dynamic Context Updates
Update user context at runtime. Change targeting without restarting your application or forcing users to refresh.
Attribute Inheritance
Define attributes at organization or team level. Users automatically inherit properties, reducing duplication.
Real-Time Evaluation
Targeting rules are evaluated instantly. Changes take effect immediately across all connected clients.
Implementation Guide
Get started with targeting in minutes
Pass Context Data
When evaluating a flag, pass context objects containing the attributes you want to target. Each context has a kind (user, organization, device) and key-value attributes.
const context = {
kind: "user",
key: "user-123",
attributes: {
email: "alice@company.com",
plan: "enterprise",
country: "US",
signupDate: "2024-01-15"
}
};
const variation = await flagpool
.evaluate("new-checkout", context);Create Target Lists
In the Flagpool dashboard, create reusable target lists for common groups. Specify which attribute the list targets (userId, email, etc.) and add values to the list.
Configure Targeting Rules
On each feature flag, add targeting rules that check attributes and return specific variations. Order rules by priority—most specific first.
userId in [beta-testers]plan = "enterprise"country in ["CA", "MX"]All other usersTest & Monitor
Test your rules with real context data before deploying. Use the dashboard to preview which variation different users will receive and monitor targeting performance.
Real-World Targeting Scenarios
How teams use advanced targeting to solve real business challenges
Beta Testing Program
Rolling out a redesigned dashboard
Need to test with internal team and select customers before broader release
Create a 'beta-testers' target list with userId attribute. Add internal team emails and select customer IDs. Configure rule: userId in [beta-testers] → new dashboard
Seamlessly add/remove beta testers without code changes. Gathered feedback from 50 users before full release, caught 3 critical bugs early.
Enterprise Feature Access
Premium analytics only for enterprise customers
Multiple enterprise customers across different organizations need access to advanced analytics
Create 'enterprise-orgs' target list with organizationId attribute. Configure rule: organizationId in [enterprise-orgs] → premium analytics enabled
Controlled feature access at organization level. Easy to add new enterprise customers to the list without deploying code.
Geographic Rollout
New payment provider launching region by region
Need to enable new payment system by country, with ability to quickly disable if issues arise
Configure rule: country in ['US', 'CA'] → new payment system. Add countries progressively: US → US+CA → US+CA+UK → global
Smooth geographic rollout over 3 weeks. Caught currency conversion bug in CA before expanding to UK. Zero downtime.
Plan-Based Features
Different features for free, pro, and enterprise tiers
Show advanced features only to paid customers, with different capabilities per tier
Multiple rules with priorities: plan='enterprise' → full features, plan='pro' → standard features, plan='free' → basic features
Clear feature differentiation across plans. Easy to adjust which features appear in each tier without code deployment.
A/B Testing Segments
Testing new onboarding flow with specific user segments
Want to test with recent signups only, not existing power users
Rule: signupDate >= '2024-11-01' AND plan != 'enterprise' → new onboarding flow. Track conversion metrics by segment.
Targeted testing with relevant users. Measured 23% improvement in activation rate without disrupting enterprise onboarding.
Internal Tool Access
Admin panel and debugging tools for team members
Enable special features for employees without exposing them to customers
Create 'employees' target list with email attribute. Add all @company.com emails. Rule: email in [employees] → admin features
Simple employee identification. New hires automatically get access when added to list. Can quickly revoke access when someone leaves.
Start Managing Feature Flags Today
Join teams who trust Flagpool to deliver features safely and efficiently.
No credit card required • Cancel anytime