> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flagsync.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Targeting

> Learn how FlagSync applies targeting rules during flag evaluation.

## User Segment Targeting

Flags can have targeting rules to serve specific variants to user groups based on attributes:

<Steps>
  <Step title="Define Rules">
    Set rules in the dashboard using attributes (e.g., `jobTitle = "QA Tester"`).

    <Frame>
      <img alt="User segment targeting rule creation" src="https://mintcdn.com/flagsync/dTCxWdoh9aH45uVC/images/flag-detailed.targeting.individual.webp?fit=max&auto=format&n=dTCxWdoh9aH45uVC&q=85&s=85c4e8d8b6d404113789aa5fd4ae700b" width="574" height="316" data-path="images/flag-detailed.targeting.individual.webp" />
    </Frame>

    <Tip>
      Learn more about targeting in [Flags: User Segments](/flags/targeting-and-rollouts#user-segments).
    </Tip>
  </Step>

  <Step title="Evaluate Clauses">
    Within a rule, clauses use logical OR—e.g., serve "Enabled" to users with `jobTitle` of "QA Tester" or "PM".

    ```typescript theme={null}
    import { FlagSyncFactory } from '@flagsync/js-sdk';

    const factory = FlagSyncFactory({
      sdkKey: 'your-sdk-key',
      core: {
        key: 'user123',
        attributes: { jobTitle: 'QA Testers' }
      }
    });
    ```
  </Step>

  <Step title="Apply First Match">
    If a flag has multiple rules, the first matching rule determines the variant served.
  </Step>

  <Step title="Halt Evaluation">
    A matched rule stops further evaluation; otherwise, it proceeds to [Rollouts](/sdks-flag-evaluation/rollouts).
  </Step>
</Steps>

## Next Steps

Continue exploring flag evaluation:

* Learn rollout logic in [Rollouts](/sdks-flag-evaluation/rollouts).
* Set up an SDK in [Setup](/sdks/setup).
* Start with [Quickstart: SDK](/quickstarts/sdk).
