Use identify() to associate the current SDK session with a known application user.

Identify a user

await userorbit.identify(user.id, {
  email: user.email,
  name: user.name,
  attributes: {
    plan: user.plan,
    role: user.role,
  },
});JavaScript

Init-time identity

You may include userId, email, name, and attributes in the first init() call when identity is already known. For authentication changes after initialization, prefer identify().

Update fields

Use setEmail(email) for email and setAttribute(key, value) for one custom attribute.

Sign-out

Call logout() when the known user signs out. Use reset() when you need to clear local SDK state, such as an account switch on a shared browser.

Privacy

Use a stable internal ID. Do not send passwords, tokens, payment data, or unnecessary sensitive information in identity attributes.

Was this helpful?