Skip to main content

Auth flow

The widget uses a dedicated widget JWT — separate from your application’s auth. Here’s how it works:

Session context

The SDK sends a WidgetContextPayload to the widget on every auth handshake:

When re-authentication happens

The widget re-authenticates in these cases:
  • Initial load — when the iframe sends hacktionbase:ready
  • First identify — when an anonymous user is identified (anonymous → known user)
  • Account switch — when identify() is called with a different account.id

Identity verification (optional)

To prevent users from impersonating others, you can enable HMAC identity verification. Generate the hash server-side using your SDK secret:
Then pass it to identify:
When userHash is provided, the API validates it before accepting the identity.