Node SDK
identify
Associate server-side behavior with a known user.
userId or anonymousId is required. Use identify after login, signup, account changes, and safe trait updates. Do not send passwords, tokens, raw profile fields, or authentication payloads.
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. |
Optional fields are context, timestamp, integrations, and messageId. The callback, when supplied as the second argument, runs after dispatch processing.