Here are the methods available in our JavaScript API
Make TransactionLinks widget reveal itself.
window.transactionlink.open();
Hide TransactionLink widget.
window.transactionlink.close();
Use this method to set options of widget.
window.transactionlink.setOptions({
token: 'exampleToken'
});
Trigger a function when a widget is fully loaded.
window.transactionlink_ready = () => {
transactionlink.setOptions({
token: 'exampleToken'
})
window.transactionlink.open()
}
We expose the methods that allow reacting and listening to events emitted from the widget.
Listening for the event about opening widget
Listening for the event about closing widget
Listening for the event about error
Listening for the event about workflow finished
Use this method to remove widget from DOM. Once unmounted, reload widget script and repeat initialisation of widget.
(https://docs.transactionlink.io/docs/js-api#how-to-implement-widget-communication)
Last updated