Skip to main content
Advanced iframe integration with event subscriptions.

Setup your development

To manually load Checkout.js, simply add the script link to the <head> of any page.

Overview

TBIframe v1.1 introduces an event-driven architecture using .on() and .off(). This version supports:
  • Multiple event listeners
  • KYC lifecycle tracking
  • Popup & redirection handling
  • Better iframe lifecycle control

Required HTML Elements

Make sure to add the following elements to your page:
Note: Root container must have the ID tb_root.

Quick Start Example

⚠️ Important Note on Mandatory Handlers

Currently, the following handlers are mandatory parameters when calling init():
  • onSessionUpdate
  • onClose
  • onTransactionUpdate
These handlers must be provided during initialization, even if you also register them using the .on() method.

🔄 Upcoming Change (Future Versions)

In a future release, these handlers will no longer be required in the init() method. Instead, all event subscriptions will be handled exclusively using the event-driven pattern:

1. Create Instance ( Constructor ).


2. Initialization & Its Behavior

The init() method can only be executed once per TBIframe instance. If you need to load a new session, create a new instance.

Parameters for init(...):

Options (TBIframeOptions)


3. Register Handlers using on

Supported Events

Parameters for on(...):


4. Remove Handlers using off

Parameters for off(...):


close()

Closes the iframe manually and triggers the onClose callback (if set).

Handler Reference

Functions that can be registered using the on method.

Example Output


Notes

  • The tb_root container must be present in your DOM for the iframe to be injected.
  • You must provide a valid session URL for payments to work.