Overview
The ZBD Widget communicates with your page from the iframe using browserpostMessage events. Use these events for frontend state such as widget readiness, close actions, cashout submission, identity verification, and linked payout methods.
Server-side cashout status updates are delivered separately as signed webhooks. See Server Webhooks.
Listening for Events
Listen for events on the parent window:Event Types
| Event | Payload | Description |
|---|---|---|
ZBD_WIDGET_READY | { user? } | Widget loaded and authenticated |
ZBD_WIDGET_CLOSE | — | User closed the widget |
ZBD_CASHOUT_SUCCESS | { cashout_id, amount, currency_code, usd_equivalent } | Cashout submitted successfully |
ZBD_KYC_COMPLETE | { tier } | Identity verification approved |
ZBD_METHOD_ADDED | { payout_method_id, type, label } | Bank account linked via Plaid |
ZBD_AUTH_TOKEN_READY | { auth_token, user? } | OTP verified, auth JWT available |
ZBD_WIDGET_ERROR | { code, message } | An error occurred |