Browser SDK

identify

Associate browser behavior with a known user.

Signature#

  • userId: optional string or number; persisted ID is used when omitted.
  • traits: optional safe user attributes.
  • options: optional context, timestamp, integrations, or anonymous ID.
  • callback: optional dispatch callback.

Call identify after signup, login, authentication refresh, or a meaningful trait update. It is the normal method after authentication.

Do not send passwords, access tokens, raw profile form values, or unnecessary personal data.

Reserved traits#

Use reserved traits only for their intended meanings. Custom traits are also supported.

TraitTypeDescription
addressobjectUser address; may contain city, country, postalCode, state, or street.
agenumberUser age.
avatarstringURL to the user avatar.
birthdaydateUser birthday.
companyobjectCompany represented by the user; may contain name, id, industry, employee_count, or plan.
createdAtdateDate the user account was created; use ISO-8601.
descriptionstringUser description.
emailstringUser email address.
firstNamestringUser first name.
genderstringUser gender.
idstringUnique user ID in your database.
lastNamestringUser last name.
namestringUser full name.
phonestringUser phone number.
titlestringUser title, usually a position.
usernamestringUnique user username.
websitestringUser website.

For anonymous-to-known behavior, use identify. For known-ID migration, use alias.