Skip to main content

Overview

reset() clears the current user identity set by identify(). Call it when a user logs out to prevent their events from being mixed with the next user’s events on the same device.

Signature

Parameters

None. reset() takes no arguments.

Example

When to call it

Always call reset() when a user logs out:

What it clears

Why this matters

If you don’t call reset() on logout:
  • User A logs out
  • User B logs in on the same browser
  • User B’s events are attributed to User A’s identity on the dashboard
Calling reset() prevents this by wiping User A’s identity from both memory and localStorage.

Complete login/logout flow