Percentage Rollouts

FlagSync uses a deterministic hashing algorithm to evaluate percentage rollouts, ensuring users receive the same variant on each evaluation.

1

Define Rollout

Set percentage distributions in the dashboard (e.g., 25% “Enabled”, 75% “Disabled”).

Percentage rollout distribution
2

Hash Inputs

Hash the user context key (e.g., user ID, email, attributes) and flag seed (unique per flag and environment).

import { FlagSyncFactory } from '@flagsync/js-sdk';


const factory = FlagSyncFactory({

  sdkKey: 'your-sdk-key',

  core: { key: 'user123' }

});
3

Normalize and Bucket

Normalize the hash to 0-99, placing users in buckets.

e.g., a normalized value of 16 falls in the 0-24 bucket, serving “Enabled” at 25%.

4

Reshuffle

In the dashboard, you can reshuffle an active percentage rollout, changing the flag seed and reassigning users to new buckets.

5

Fallback

If no rollout applies, the default “on” variant is served.

Return to Flag Evaluation: Overview for the full flow.

Next Steps

Explore more about flag evaluation and SDKs: