onEvent

Handle real-time events on the widget

Widget Events

The onEvent callback is called anytime there is a significant event on your widget. It takes one arguments, an event object which is a metadata JSON object. The event parameter is always present, though some values may be null. You can find a list of events below:

🚧

Did you check if there was an error?

Make sure to check the withError parameter. If this is false, then the user did not receive an error. This is especially important with the WIDGET_USER_INTERNET_DISCONNECTED event. If there was no error then the user will be reconnected.

Event Example

{
        type: 'EVENT',
        event: 'EVENT_NAME'
        withError: true or false, //whether or not their was an error
        location: "STRING",//the screem the user was on when this happened
        data: "JSON OBJECT", //the object returned at this time.
        error: "STRING" // error if any returned
      }

All Events

Event Name

Event Description

WIDGET_ERROR_USER_SHOWN

Error on the widget shown to the user

WIDGET_SUCCESS_USER_SHOWN

Success on the widget shown to the user

WIDGET_PAYMENT_PENDING

User received pending payment screen on widget

WIDGET_RETRY_OTP

User asked for a new OTP

WIDGET_BANK_LOADED

User's selected bank completed loading

WIDGET_LOGIN_ATTEMPTED

User entered their credentials and hit the login button

WIDGET_QUESTION

User was shown a question to answer e.g. security, OTP, PIN, etc.

WIDGET_PAYMENT_REVIEW

User was asked to review and confirm payment

WIDGET_PROFILE_ACCOUNT_REVIEW

User was asked to profile their account

WIDGET_SUBMIT_IDENTITY

User BVN / RC Number was not available at their bank or authority and was asked to submit this via the widget.

WIDGET_COMPLETE_PROFILING

User has not completed setting up this internet or mobile banking account and was asked to complete profiling their profile.

WIDGET_FETCH_TRANS

Widget has attempted to fetch transactions

WIDGET_USER_INTERNET_DISCONNECTED

User disconnected from internet

WIDGET_SUBMIT_GUARANTORS

User was asked to submit guarantors

WIDGET_ACCOUNT_SELECTION

User was shown their balance/accounts and asked to select one to continue


What's Next

Get started by integrating the Widget with any of our Libraries or SDKs, or jump right into one of our most popular ones.

Did this page help you?