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.
For anonymous-to-known behavior, use identify. For known-ID migration, use alias.