Skip to Content
ConceptsRollout Gradual

How rollout works

When a flag is of type rollout, CanaryGate determines whether a specific user should see the feature based on:

  1. The user’s userId (passed in the SDK options or implicit)
  2. The flag key (key)
  3. The percentage configured in the dashboard

The calculation uses a deterministic hash: the same user with the same userId will always receive the same result for the same percentage. This ensures stickiness — the user does not alternate between versions.

Configuring in the SDK

const canary = new CanaryGate('cg_api_key', { userId: currentUser.id // or a stable anonymous string }) await canary.init() const flag = canary.getFlag('new-dashboard') if (flag?.enabled) { // this user is in the rollout }

If you do not pass a userId, the SDK uses a stable anonymous ID generated and persisted in localStorage (browser) or in memory (Node.js). Anonymous users are also handled deterministically.

Increasing the percentage

Typical canary deploy workflow:

PhasePercentageAction
Beta5%Monitor metrics and errors
Expansion25%Confirm stability
Ramp50%Half the traffic
GA100%Feature available to everyone

Each percentage adjustment is delivered in real time via SSE to all connected clients.

Manual vs automatic rollout

  • Manual: You adjust the percentage manually through the dashboard
  • Automatic (Pro plan): Configure a schedule that increases the percentage automatically at defined times

See Schedule and Auto-rollout for more details.

Last updated on