Complete Guide

Feature Flag Segments: Rule-Based & List Segments Explained

Segments are reusable audience definitions you attach to feature flags. Define "Enterprise customers" once and reference it from every flag, so a single update propagates everywhere instantly.

9 min read·Last updated March 2026
01 · Foundations

What are segments?

A segment is a named, reusable audience. Instead of duplicating targeting rules across every flag, you define the audience once and reference it by name.

Without segments, every flag that targets enterprise users must repeat the same conditions: plan = enterprise AND mrr > 500. Change the definition and you have to touch every flag.

With segments, you define "Enterprise customers" once. Reference it from 14 different flags. Update the definition and all 14 flags update instantly, with a single change and a single audit log entry.

There are two segment types. Rule-based segments evaluate conditions against user context at runtime; membership is automatic. List segments contain an explicit set of user or account IDs; membership is curated manually.

Without segments · rules duplicated across flags
ai-sidebar
plan = "enterprise" AND mrr > 500
new-nav
plan = "enterprise" AND mrr > 500
advanced-analytics
plan = "enterprise" AND mrr > 500
priority-support
plan = "enterprise" AND mrr > 500
Change enterprise criteria → update 4 flags manually
With segments · defined once, used everywhere
SEGMENT · Enterprise customers
plan = "enterprise" AND mrr > 500
ai-sidebar↑ Enterprise customers
new-nav↑ Enterprise customers
advanced-analytics↑ Enterprise customers
priority-support↑ Enterprise customers
Change criteria → 1 update, all 4 flags stay in sync
02 · Rule-based segments

Conditional rule-based segments

Membership is computed automatically at flag evaluation time. If a user matches the conditions, they are in the segment with no manual updates needed.

Rule-based segments evaluate a set of conditions against the user context object passed to the SDK at flag evaluation time. If all conditions pass (AND logic) or any condition passes (OR logic), the user is a member.

Conditions support a range of operators across string, number, and boolean attribute types. You can chain conditions with AND / OR and nest groups for complex audiences.

Rule-based segments
Segment editor · "Enterprise customers"Rule-based

Segment Rules

Configure rules that determine which users belong to this segment based on their attributes.

1
If
Splan
=
enterprise ×
and
Nmrr
>
500
and
Scountry
CN ×
Matched users (live)
4,821
Flags using this
14
Last evaluated
now

AND logic

All conditions must be true. Narrows the audience. Use to tightly target a specific cohort.

OR logic

Any condition must be true. Broadens the audience. Use to union multiple criteria into one segment.

Nested groups

Combine AND and OR with parentheses to build complex logic:(plan = "enterprise" AND mrr > 500)
OR
(betaOptIn = true AND signupDaysAgo < 30)

03 · List segments

List segments

An explicit allowlist of user or account IDs. Membership is managed manually, useful when the audience cannot be described by a rule.

Some audiences resist rule-based definition. Your five largest enterprise accounts might all be on different plans, different MRR brackets, and different regions. No single condition captures them, but you know exactly who they are.

List segments store a set of identifiers — typically user IDs or account IDs that are checked at evaluation time. If the user's ID appears in the list, they are in the segment.

Closed beta list
Collected via sign-up form. 212 users who opted in to try unreleased features.
Key accounts
Curated by customer success. These accounts get new features first, regardless of plan.
Internal employees
Your own team for dogfooding. Refreshed automatically from your HR directory via API.
Segment · "Key accounts"List

List Items

Add values to create a static list for this segment. Enter comma-separated values.

Add Items ( userIds )

Enter comma-separated values

Separate multiple values with commas

Items in List (4)

user_3391 ×user_9120 ×user_7745 ×user_5501 ×
Used in 11 flagsLast updated 2 days ago
Audit log
addeduser_3391[email protected]2d ago
removeduser_0042[email protected]5d ago
addeduser_9120[email protected]5d ago
addeduser_5501API · deploy-script14d ago
04 · Combining

Combining rule-based and list segments

A single flag can reference both segment types in the same targeting rule. Mix and match to build precise audiences without duplication.

Aspect
Rule-based
List
Membership changes
Automatic, re-evaluated on every flag call
Manual, add/remove IDs explicitly
Setup time
Minutes: write the condition once
Longer: collect and curate the list
Scale
Unlimited, works for millions of users
Hundreds to low thousands (lookup overhead)
Precision
Depends on attribute quality
Exact, only listed IDs match
Common use case
Tier, region, behaviour-based audiences
Key accounts, beta lists, internal team
Audit trail
Implicit in the rule definition
Who added / removed each ID, and when
Flag · ai-sidebar · rule set
Rule 1 · always onList segment
Key accountstrue
38 manually curated IDs
Rule 2 · always onRule segment
Enterprise customerstrue
plan = enterprise AND mrr > 500
Rule 3 · 20% rolloutRule segment
Beta testerstrue (20%)
betaOptIn = true
Default→ false

Who gets the feature

Any of the 38 key accounts
Enterprise plan + MRR > $500
20%20% of users who opted into beta
All other users
05 · Lifecycle

Segment lifecycle

Segments are living objects. They evolve as your product and user base grows. Here is how to keep them healthy.

01
Create

Start with the simplest possible definition. Premature complexity in a segment is hard to unwind. A broad segment can be narrowed; an overly narrow one causes you to duplicate it.

Name it from the user's perspective, not the technical rule.
02
Attach

Reference the segment from flags. Every flag that already has an equivalent inline rule is a candidate for migration; consolidating to a segment reduces maintenance surface.

Track how many flags reference each segment. High usage means high impact of any change.
03
Refine

As you learn more about the audience, update the segment definition. All flags referencing it pick up the change instantly, with a single change event in the audit log.

Review segments quarterly. Stale definitions are as bad as stale flags.
04
Archive

When a segment is no longer relevant (e.g. a beta programme ends), archive it. Archiving detaches it from all flags and preserves the history without cluttering the active list.

Check for 0-usage segments monthly and archive promptly.
Segment health overview6 segments · 2 need attention
Rule
Enterprise customers
All paying enterprise accounts over $500 MRR.
14
flags
Rule
EU & EEA users
GDPR-scope audience for compliance-gated features.
8
flags
Rule
New signups
Users who joined in the last 7 days, for onboarding flows.
5
flags
List
Key accounts
38 account IDs manually curated by the customer success team.
11
flags
List
Closed beta testers
212 user IDs collected via sign-up form.
7
flags
List
Internal employees
Team member user IDs for dogfooding unreleased features.
19
flags

Get started

Build your first segment in minutes

Supaship supports both rule-based and list segments, reusable across unlimited flags. Free to start.