Identify users
Automatic identity
Let the widget read the signed-in person from window.whazzupSettings.
Settings object
The loader reads window.whazzupSettings when it starts, so no manual call is needed. Set it before the script tag, or update it from your app at any time.
window.whazzupSettings = {
name: 'Ada Lovelace',
email: 'ada@example.com',
userId: '42',
plan: 'pro'
}Known keys are name, email, company, userId and token. Every other simple value is stored as a custom attribute.
Updates and logout
Whazzup detects a changed stable user ID or email and rotates the local session. Explicitly call reset before an in-app account switch, and logout when the person signs out. Both commands invalidate the old session and prevent conversation history crossing account boundaries.
// Before switching to another account
window.whazzup('reset')
window.whazzupSettings = nextUser
// On logout
window.whazzupSettings = null
window.whazzup('logout')Unverified vs verified
Data sent this way is stored as unverified, because browser code can be changed by anyone. Add a server-signed token field to get verified contacts.
