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.
| Trait | Type | Description |
|---|---|---|
address | object | User address; may contain city, country, postalCode, state, or street. |
age | number | User age. |
avatar | string | URL to the user avatar. |
birthday | date | User birthday. |
company | object | Company represented by the user; may contain name, id, industry, employee_count, or plan. |
createdAt | date | Date the user account was created; use ISO-8601. |
description | string | User description. |
email | string | User email address. |
firstName | string | User first name. |
gender | string | User gender. |
id | string | Unique user ID in your database. |
lastName | string | User last name. |
name | string | User full name. |
phone | string | User phone number. |
title | string | User title, usually a position. |
username | string | Unique user username. |
website | string | User website. |
For anonymous-to-known behavior, use identify. For known-ID migration, use alias.