Listening to Events
We strongly recommend using one of the Opal SDKs to receive typed events and lifecycle callbacks. The SDKs provideonEvent, onOpen, and onExit handlers and expose a small enum of well-known events under OpalEventType for convenience (e.g., SESSION_STARTED, SESSION_COMPLETED).
Each Opal mode (identity_verification, connect, card_connect, account_verification, transactions, balance_transfer) emits a set of mode‑specific events in addition to default session events. See below for structure, a complete list, and examples.
Event Structure
All Opal events follow a consistent structure:Event fields
Possible flows:
identity_verificationconnectaccount_verificationtransactionsbalance_transfer
Sample Events
opal.session.started
opal.session.errored
connect.flow.completed
Event Categories
Default session events (always available)
opal.session.started- Opal UI opened and session beganopal.session.completed- User completed the flow successfullyopal.session.errored- A recoverable or terminal error occurredopal.session.exited- User exited or dismissed Opal
Generic flow and step events
Emitted in addition to the default session events. These mirror the active mode‑specific events but are prefixed withopal and can be emitted for any mode.
Flow
opal.flow.started- A sub‑flow of Opal started (e.g., identity verification, account selection, verification).opal.flow.completed- A sub‑flow of Opal completed. This does not always signify the end of the session; useopal.session.completedto detect when Opal is fully completed.
Step
opal.step.started- A new step started (e.g., phone input, card selection, CVV input).opal.step.completed- A step completed and the next page is opening.
- Additional mode-specific events may be introduced over time. Your handler should use the
OpalEventTypeenum to handle the specific cases you need.
All Event Types
The following table lists all currently supported event types with theirOpalEventType mapping, and when they are typically emitted.
Balance Transfer events
TheOpalEventType enum does not include constants for Balance Transfer events. Match these events on event.type.
See Balance Transfer for the payload of each event.
Data Payloads
The following events always include a non-nullevent.data payload:
identity_verification.identity.completedconnect.accounts.selectedaccount_verification.card.verifiedtransactions.accounts.linkedbalance_transfer.amounts.confirmed
Enhanced Event Handling
Using the JavaScript SDK
PostMessage Communication
For applications not using the Opal SDKs, you can listen to events via PostMessage:Setup PostMessage Listener
Best Practices
Event Handling
- Always verify event origins for security
- Use event filtering to reduce noise
- Implement proper error handling for all events
- Log events for debugging and analytics
Security
- Validate all event data before processing
- Never trust client-side events for critical business logic