# Anonymous → authenticated

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

Source: https://docs.useclad.ai/identify-upgrade

---

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.

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