Skip to main content

Architecture

The Hacktionbase widget is an iframe embedded in your page by the SDK. It communicates with the SDK via the browser’s postMessage API.

Components

The widget consists of two visible elements:
  1. Bubble — a floating button in the corner of the page. Clicking it toggles the panel open/closed.
  2. Panel — the iframe containing the widget UI (conversations, messages).

Lifecycle

  1. Hacktionbase.init() fetches the widget configuration from the API
  2. The SDK injects CSS, creates the bubble, and creates a hidden iframe
  3. When the iframe loads, it sends hacktionbase:ready
  4. The SDK responds with config and session context
  5. The widget authenticates via the widget auth endpoint and receives a JWT
  6. The user can now open the panel, view conversations, and receive in-app messages

PostMessage protocol

All messages between the SDK and widget use a hacktionbase: prefix:

SDK → Widget

Widget → SDK

All postMessage communication is origin-verified. The SDK only accepts messages from your tenant’s widget origin ({tenant}.hacktionbase.com).