Documentation Index
Fetch the complete documentation index at: https://docs.hacktionbase.com/llms.txt
Use this file to discover all available pages before exploring further.
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 identity data.
Your application’s unique user ID (external ID).
Account/company the user belongs to. Must include an id field.
HMAC hash for identity verification (prevents impersonation).
Any additional custom attributes are stored on the user profile.
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:
This rotates the session, clears stored identity, and re-authenticates anonymously.