User Segments
Pro Segments are a Pro-only feature.
Segments are reusable user groups that you can reference across multiple targeting rules. Instead of duplicating conditions like “enterprise users in US” in every flag, create a segment once and use it everywhere.
Why Use Segments?
Before Segments
Without segments, you duplicate conditions across flags:
Flag: new-checkout Rule 1: email ends_with "@acme.com" AND custom.plan = "enterprise" → Enable
Flag: dashboard-v2 Rule 1: email ends_with "@acme.com" AND custom.plan = "enterprise" → Enable
Flag: analytics-feature Rule 1: email ends_with "@acme.com" AND custom.plan = "enterprise" → EnableAfter Segments
With segments, define once, use everywhere:
Segment: Enterprise Users email ends_with "@acme.com" AND custom.plan = "enterprise"
Flag: new-checkout Rule 1: In segment "Enterprise Users" → Enable
Flag: dashboard-v2 Rule 1: In segment "Enterprise Users" → Enable
Flag: analytics-feature Rule 1: In segment "Enterprise Users" → EnableBenefits
- Single source of truth: Update segment definition in one place
- Consistency: Same users match across all flags using the segment
- Easier management: Name segments for clarity (“Beta Testers” vs complex conditions)
- Less duplication: Reduce errors from copying conditions
Creating a Segment
Segments are created at the project level and can be used by any flag in that project.
- Open your project and click Segments in the navigation
- Click New Segment
- Configure:
- Name: Human-readable name (e.g., “Enterprise Customers”)
- Description: What this segment represents
- Rules: Conditions that define membership
Example: Beta Testers Segment
Name: Beta TestersDescription: Users who opted into our beta program
Conditions: ANY match ├─ email ends_with "@beta.featsync.io" └─ custom.beta_opted_in equals trueExample: Enterprise Segment
Name: Enterprise UsersDescription: Customers on enterprise plans
Conditions: ALL match ├─ custom.plan equals "enterprise" └─ custom.account_status equals "active"Using Segments in Rules
When creating or editing a targeting rule on a flag, you can choose between inline conditions or using a pre-defined segment:
- Open a flag and expand the Targeting section for an environment
- Click Add Rule or Edit on an existing rule
- Under Match by, toggle between:
- Conditions: Define inline attribute-based conditions
- Segment: Select a pre-defined segment from the dropdown
- Configure the serve behavior (Enable/Disable)
- Click Save Changes
Flag: advanced-analytics
Rule 1: ├─ Use Segment: "Enterprise Users" └─ Serve: Enabled
Rule 2: ├─ Conditions: custom.analytics_beta equals true └─ Serve: Enabled
Default: DisabledSegment Evaluation
When a rule references a segment, the segment’s conditions are evaluated as if they were inline:
Request: evaluate("advanced-analytics", { userId: "123", custom: { plan: "enterprise", account_status: "active" }})
Rule 1: Use Segment "Enterprise Users" └─ Segment conditions: custom.plan = "enterprise" AND custom.account_status = "active" └─ ✓ Both match → Rule matches
Result: enabled: true, reason: "segment", segmentId: "seg_xxx"The reason field will be "segment" when a segment rule matches, and segmentId identifies which segment.
Best Practices
1. Name Segments Clearly
Use descriptive names that explain the group:
✓ Good: "Enterprise Customers", "Beta Testers", "Internal Team"✗ Bad: "Segment 1", "Test Group", "Users"2. Keep Segments Focused
Each segment should represent a single cohesive group:
✓ Good: "Enterprise US Customers" - clear, specific group✗ Bad: "Enterprise or Beta" - combines unrelated groups3. Document with Descriptions
Add descriptions explaining when to use the segment:
Name: High-Value CustomersDescription: Customers with >$10k MRR. Use for early access to premium features.4. Audit Segment Usage
Before modifying a segment, check which flags use it:
- Segment changes affect all flags referencing it
- Consider creating a new segment instead of modifying existing ones
Segments vs Inline Rules
| Use Segments When | Use Inline Rules When |
|---|---|
| Same group across multiple flags | Conditions are flag-specific |
| Group definition might change | Simple, one-time conditions |
| You want named groups for clarity | Quick testing or temporary rules |
| Team members need to understand targeting | Performance-critical (1 fewer lookup) |
Plan Availability
| Feature | Free | Pro |
|---|---|---|
| Inline targeting rules | 2 per flag | Unlimited |
| Segments | - | Unlimited |
Related
- Targeting Rules - How targeting works
- SDK Targeting - Implementation guide
- Pricing - Plan comparison