c.l.cladDocs

Anonymous → authenticated

Upgrade an anonymous session to an identified user and merge conversation history.

If a visitor chats anonymously and later logs in, call identify() to upgrade the session in place. Anonymous conversation history is merged into the identified user when safe; if the user already had conversations, those appear after the upgrade.

await chat.identify({
  user: { id: "user_123", email: "rachel@example.com", name: "Rachel" },
  company: { id: "org_456", name: "Acme Inc" },
  tokenProvider: fetchSupportChatToken,
});