Architecture
The Hacktionbase widget is an iframe embedded in your page by the SDK. It communicates with the SDK via the browser’spostMessage API.
Components
The widget consists of two visible elements:- Bubble — a floating button in the corner of the page. Clicking it toggles the panel open/closed.
- Panel — the iframe containing the widget UI (conversations, messages).
Lifecycle
Hacktionbase.init()fetches the widget configuration from the API- The SDK injects CSS, creates the bubble, and creates a hidden iframe
- When the iframe loads, it sends
hacktionbase:ready - The SDK responds with config and session context
- The widget authenticates via the widget auth endpoint and receives a JWT
- The user can now open the panel, view conversations, and receive in-app messages
PostMessage protocol
All messages between the SDK and widget use ahacktionbase: 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).
