Skip to content

What is a segment in feature flags?

Updated November 15, 2026

A segment is a named, reusable group of users or other contexts, such as "beta testers" or "EU customers", defined by a list or by conditions, that several feature flags can target at once.

How do segments work?

Instead of repeating the same conditions on every flag, you define the group once and reference it from each flag's targeting rules. Changing the segment changes who gets every flag that uses it.

Tool Definition Notable rules
LaunchDarkly Segments "group together users, accounts, or other contexts" Environment-specific; several segments in one condition are ORed
Unleash "A reusable collection of strategy constraints" An empty segment always matches; default limits of 1,000 constraint values per segment, 5 segments per strategy and 300 per instance

Sources: LaunchDarkly segments, Unleash segments.

What does a segment look like in a flag file?

flagd has no segment object, but shared evaluators do the same job: define the condition once under $evaluators and reference it from any flag with $ref. In our targeting rule example, beta_testers is a list of emails used by the release_new_checkout rule; adding an email to it changes every flag that references it.

When should I use a segment?

  • The same group appears on several flags: beta users, internal staff, a pilot customer list.
  • The group changes often: edit it once instead of every flag.
  • Not for billing: who has paid for a feature belongs in your billing or entitlement system, not a hand-maintained segment (entitlements vs feature flags).