Menu

Segments

Last updated February 11, 2026

Segments are reusable groups of users for targeting feature flags. Instead of recreating "email ends with @yourcompany.com" for every internal feature, you create an "Internal Team" segment and reference it wherever needed.

When you update a segment's rules, every flag using that segment updates automatically. This keeps targeting consistent and makes bulk changes simple.

SegmentDescriptionExample rules
Internal TeamYour employeesEmail ends with @yourcompany.com
Beta UsersEarly adopters testing new featuresUser has beta: true attribute
Enterprise CustomersHigh-tier paying customersPlan equals enterprise
US UsersUsers in the United StatesCountry equals US
  1. Navigate to the Flags tab in your project
  2. Click Segments in the sidebar
  3. Click Create Segment
  4. Enter a name and description
  5. Define the targeting rules

Segment rules use entities to match users. Each rule checks an attribute against a condition.

Building a rule:

  • Attribute: The entity property to check (e.g., user.email, team.plan)
  • Operator: How to compare the value:
    • equals / does not equal
    • contains / does not contain
    • starts with / ends with
    • is one of / is not one of (for lists)
  • Value: What to match against

Combining rules:

You can combine multiple conditions with AND or OR logic:

user.email ends with "@yourcompany.com" OR user.role equals "admin"

This segment matches anyone with a company email OR anyone with the admin role.

Segments are available in all environments (Production, Preview, Development). If you need different targeting per environment, create separate segments with environment-specific names (e.g., "Beta Users - Production").

Once you've created a segment, you can use it when configuring flag targeting:

  1. Go to a flag's configuration
  2. Click the Target icon next to an environment
  3. Click Add a Target
  4. Select your segment from the dropdown
  5. Choose which variant to serve to users in this segment

Segments can be combined with other rules and targets in your flag configuration.

When you edit a segment's rules, the change applies everywhere the segment is used. This makes it easy to update targeting across multiple flags at once.

  1. Go to Segments in the Flags tab
  2. Click on the segment you want to edit
  3. Modify the rules
  4. Save your changes

All flags using this segment will immediately use the updated rules.

To delete a segment, it must not be in use by any flags or other segments.

You can see the flags and segments currently referencing a segment on the Segment details page.

If a segment is referenced by a flag or segment:

  1. Go to each flag (or segment) using the segment you want to delete
  2. Remove the segment from the targeting rules
  3. Return to Segments and delete it

Was this helpful?

supported.