Skip to content
Gates

identify and reset

gates.identify({ id: "user_123", traits: { plan: "pro", country: "PT" } });
gates.reset(); // sign-out

With <GatesProvider user={…}> you rarely call these yourself: the provider calls identify when user changes and reset when it becomes null.

What identify does

  • Re-evaluates immediately. Every useFlag subscriber re-renders with the new identity.
  • Switches the rollout identity from the installation to user.id, so a percentage rollout follows the person across their phones.
  • Makes user.id and user.<trait> available to rules. Traits are string | number | boolean.
  • Clears the exposure dedupe, so the next read of each flag records exposure for the new user.
  • Schedules a sync after a 500 ms debounce, so the server learns who is signed in. A burst of identify and reset calls, as auth flows tend to produce, costs one request.

The server records the user, their traits and the device with the sync; that is what the People screens show. See People.

What reset does

Forgets the user, re-evaluates with the installation as identity, clears the exposure dedupe and schedules the same debounced sync.

Identity and bucketing

The bucketing identity is user:<id> when identified, otherwise inst:<installationId>. See Rollouts and bucketing.