User-Specific Feature Flag Targeting
Target specific users by ID to enable features for beta testers, internal teams, or individual accounts. Fine-grained control for feature previews.
Detailed Explanation
User-Specific Targeting
User targeting enables a feature for specific individuals by their user ID. This gives you precise control over who sees a feature, making it ideal for beta programs, internal testing, and VIP access.
Configuration Example
{
"advanced-analytics": {
"name": "Advanced Analytics Dashboard",
"description": "New analytics with real-time charts and custom reports",
"type": "boolean",
"enabled": true,
"defaultValue": false,
"targeting": [
{
"type": "user-ids",
"userIds": "user-001, user-042, user-108, admin-jane, admin-bob"
}
]
}
}
LaunchDarkly Targets
In LaunchDarkly, individual targeting uses the targets array:
{
"targets": [
{
"variation": 0,
"values": ["user-001", "user-042", "user-108", "admin-jane", "admin-bob"]
}
]
}
Unleash UserWithId Strategy
Unleash uses the userWithId strategy:
{
"strategies": [
{
"name": "userWithId",
"parameters": {
"userIds": "user-001,user-042,user-108,admin-jane,admin-bob"
}
}
]
}
Combining with Other Rules
User targeting is often combined with other rules. The evaluation order typically is:
- Individual targets (highest priority) -- specific user IDs
- Segment rules -- group-based targeting
- Percentage rollout -- catch-all for remaining users
- Default value -- fallback when no rules match
When to Use User Targeting
| Scenario | Example |
|---|---|
| Internal testing | Enable for your team before launch |
| Beta program | Give early access to opted-in users |
| VIP customers | Premium features for enterprise accounts |
| Debugging | Enable verbose logging for a specific user |
| Demo accounts | Always show the latest features |
Scaling Considerations
Individual user targeting works well for small lists (up to a few hundred users). For larger groups, use user segments instead to avoid maintaining long user ID lists in your flag configuration.
Use Case
A product team builds a new analytics dashboard and wants to gather feedback before launch. They enable the feature for 5 internal users and 10 beta testers by their user IDs. Once feedback is incorporated, they switch to a percentage rollout for broader release.