Identify users
Login and logout
Identify after login and clear state during logout.
After login
Request a fresh token from your own authenticated endpoint on every page load (and after login), then call identify. Calls made before the iframe is ready are queued and deduplicated. Without the token the person is stored with their data but stays marked as unverified.
const { token } = await fetch('/api/whazzup-identity').then(r => r.json())
whazzup('identify', { token })Account changes
Call reset before identifying a different account. It invalidates the old session and creates a new isolated visitor context. The loader also rotates automatically when a stable user ID or email changes.
whazzup('reset')
window.whazzupSettings = nextUserOn logout
window.whazzupSettings = null
whazzup('logout')