Skip to main content
Hacktionbase.identify(user)
Links the current anonymous session to a known user. Call this after the user logs in or when you know who they are.

Parameters

user
UserData
required
User identity data.

Example

Hacktionbase.identify({
  id: 'user_123',
  email: 'jane@example.com',
  name: 'Jane Doe',
  account: { id: 'org_456', name: 'Acme Inc' },
  plan: 'growth',
  signedUpAt: '2024-01-15'
});

Behavior

  • On first call (anonymous → identified), the SDK re-authenticates with the widget to get a user-scoped JWT.
  • If the user switches accounts (different account.id), the session is rotated and replay restarts.
  • Custom attributes (any key beyond id, email, name, account, userHash) are stored as user properties and can be used in segments and campaigns.

Logout

To clear the user identity and return to anonymous mode:
Hacktionbase.logout();
This rotates the session, clears stored identity, and re-authenticates anonymously.