Listen to Widget events

The widget calls onEvent for every event it emits. Define the callback as follows:

function onEvent(eventName, metadata) {
	// use eventName and metadata
}

eventName is a string naming the event that triggered the callback. metadata is an object with information about that event. Some metadata attributes can be null.

The metadata object can contain the following attribute:

ParameterDescription
timestampTimestamp marking when the widget emitted the event.
🚧

The metadata object can include more fields over time, so do not assume the object's fields are limited to the ones documented today.

List of events

The widget emits the following events:

Event nameDescription
openedTriggers when your user opens the widget.
on_terms_and_conditionsTriggers when your user visits the terms and conditions.
codi_helperTriggers when your user visits the CoDi Helper Guide.
on_available_institutionsTriggers when your user opens the financial institution selection view.
on_request_bankTriggers when your user opens the view to request a new bank.
on_authentication_formTriggers when your user opens the view to authenticate with their financial institution.
codi_username_requiredTriggers when your user is prompted to enter their mobile phone to receive a CoDi payment request.
payment_in_progressTriggers when your user is asked to select the payment provider.
creating_linkTriggers when the financial institution verifies the credentials and Fintoc connects the account.
link_createdTriggers when the financial institution approves the credentials and Fintoc creates a Link.
selecting_accountTriggers when your user opens the view to select an account.
payment_intent_confirmation_requiredTriggers when your user is prompted to authorize the payment.
app_authentication_requiredTriggers when the financial institution requires a second factor through an app.
creating_subscriptionTriggers when your user starts creating a subscription.
payment_direct_transferTriggers when your user views the direct transfer screen.
device_authentication_requiredTriggers when the financial institution requires a second factor through a physical device.
card_authentication_requiredTriggers when the financial institution requires a second factor through a coordinate card.
sms_authentication_requiredTriggers when the financial institution requires a second factor by SMS.
email_authentication_requiredTriggers when the financial institution requires a second factor by email.
captcha_authentication_requiredTriggers when the financial institution requires a second factor through a captcha.
validating_second_factorTriggers when the financial institution validates the second factor your user entered.
subscription_createdTriggers when Fintoc creates a subscription.
subscription_abortedTriggers when a constraint prevents Fintoc from completing the subscription. For example, your user may have already completed the same subscription.
payment_createdTriggers when a payment succeeds.
payment_errorTriggers when a payment fails.
payment_selecting_authTriggers when your user selects a second factor method to authenticate.
validating_paymentTriggers when Fintoc validates the payment.
closedTriggers when your user closes the widget.
on_errorTriggers when an error occurs in the flow.