CallDocumentation Index
Fetch the complete documentation index at: https://docs.getmilana.ai/llms.txt
Use this file to discover all available pages before exploring further.
identify() to link the current session to a user in your system — typically right after the user signs in. This is the simplest entry point for user association; it unlocks user-level filtering in the dashboard and enables AI queries to reason about specific users.
- React
- JavaScript
- Script Tag
Use the
useMilana() hook:Parameters
A stable, unique identifier for the user in your system. This is the primary key Milana uses to link sessions to a user. Use your database user ID or a similar permanent identifier — do not use an email address as the primary ID.
The user’s email address. Used to connect user identity across your systems (e.g. support tools, CRM, data warehouse) and displayed in the dashboard.
The user’s display name.
Arbitrary key-value pairs to attach to the user. Keys are strings, values can be
string, number, boolean, null, or nested objects/arrays of the same types. e.g. plan, team, country, role, accountType.We strongly recommend including a createdAt key (ISO 8601 timestamp, e.g. "2024-03-15T00:00:00Z") so Milana can distinguish new users from returning users and support cohort analysis.Return value
true if the identification was applied to the session. false if the session was not active, the network request failed, or the session was not sampled.Timing
identify() is safe to call before init() completes — the SDK queues the call and replays it once the session is ready.