Segment targeting

Also called: audience targeting

Last updated:

Segment targeting evaluates a feature flag against a segment: a reusable, named group of users defined by rules over their attributes rather than an ad-hoc list. Define "internal staff" or "enterprise plan" once, then point any flag at that segment. Membership is computed at evaluation time from the user context you pass in.

Segments vs inline targeting rules

You can target a flag two ways. An inline targeting rule lives on a single flag, such as "serve true when plan is pro". A segment factors that audience out so many flags can share it: change the segment definition once and every flag pointed at it updates. Segments are the right tool when the same audience recurs across flags, while inline rules suit one-off conditions. In Featureflip, segments use flat conditions with AND/OR logic while flag rules use condition groups. See the user targeting and segments guide.

How segment targeting is evaluated

At evaluation, the SDK checks the user context (id, plan, region, custom attributes) against each segment's conditions and each flag rule, then serves the matching variation. Because it runs locally against in-memory configuration, the check is sub-millisecond. Segment targeting composes with a percentage rollout: target a segment, then roll out to a percentage within it, which is the basis of a targeted rollout.

Want the full picture? Read the concept guide: User targeting & segments →

Try it in your own app

The Free plan covers 10 flags and 2 environments. No credit card, no demo call — sign up and ship.