Callback events

Stay informed about user events and simplify taking additional action with callbacks.


Callbacks provide information when specific events take place in your Okra app implementation. Improve your application's usability and enhance user experience by building workflows, front-end responses, and automation around the callbacks that Okra offers.

Callback types

EventDescriptionExample usage
onSuccessCalled when a user has successfully connected their account to your Okra app and created a record. The function expects one argument, the metadata JSON object.- Display a confirmation message to the user to show that their account has been successfully linked.
- Log the success events to build analytics and gain user insights.
onCloseCalled when a user exits the Okra app flow. This callback does not expect any arguments.- Display an appropriate call-to-action message or guide your users to an alternative workflow.
- Log timestamps and event details to understand conversion and bounce rates.
onErrorCalled when an error occurs during the Okra app initialization. It accepts one argument, an error object that contains details about the error that occurred.- Display error-specific warnings or messages on the front end for your users.
- Define fallback workflows to keep users in your application.
onEventCalled every time there is a significant event in your Okra app. It takes one argument, an event object which is a metadata JSON object. The event parameter is always present, though some values may be null.- Log the event_name parameters to gain insight into how your users interact with your application and build analytics around the data.

Sample implementation using JavaScript

import Okra from 'npm-okrajs';

const OkraHandler = Okra.buildWithOptions({
  ...,
  onSuccess: (data) => {
    console.log('You have linked an account!', data)
  }
});
import Okra from 'npm-okrajs';

const OkraHandler = Okra.buildWithOptions({
  ...,
  onClose: function () {
    console.log("widget is being closed");
  }
});
import Okra from 'npm-okrajs';

const OkraHandler = Okra.buildWithOptions({
  ...,
  onError: function (error) {
    console.log("error has occured", error);
  }
});
import Okra from 'npm-okrajs';

const OkraHandler = Okra.buildWithOptions({
  ...,
  onEvent: (event) => {
    console.log("Event Payload", event);
  }
});

List of onEvent parameters

General events

These events give you information about general actions around the Okra app, like loading, app closure, and network issues.

Event nameFlow typeonEvent parameter nameEvent trigger
Clicks to view termsGeneralconsent_reviewTriggers when the Terms of Service page loads.
App loadedGeneralconnectedUser sees the fully loaded landing page.
App initiationGeneralconnectingUser is attempting to connect to the app - a user has launched our SDK. This event triggers when the loader is activated.
Search bankGeneraluser_bank_searchUser is typing in the search field.
Poor network modalGeneralbad_networkTriggers when the the poor network warning modal loads.
Network disconnectedGeneralnetwork_disconnectedUser is disconnected from the internet.
Network reconnectedGeneralnetwork_reconnectedUser reconnected to the internet.
BounceGeneralbounceUser closed the app without completing the account connection.
Completed app flowGeneralapp_closeUser closed the app from a success or error screen.
Invalid linkGeneralinvalid_linkTriggers when the invalid link error screen loads.

Data events

These events give you information about user interaction and app events in the Account data flow.

Event nameFlow typeonEvent parameter nameEvent trigger
Showing account type screenData flowdata_account_typeTriggers when the account type selection screen loads for a data app.
Showing bank screenData flowdata_viewed_banksTriggers when the bank selection screen loads.
Select bankData flowdata_select_bankTriggers when the user selects a bank on the app.
Credentials screenData flowdata_login_screenTriggers when the account credentials entry screen loads.
Login attemptData flowdata_login_attemptTriggers when the user clicks the continue button to confirm login credentials.
Login methodData flowdata_login_method_selectionTriggers when the user chooses a login method: internet or mobile banking.
Select account(s)Data flowdata_select_accountsTriggers when the the account selection screen loads.
SuccessData flowdata_connection_successfulTriggers when the user is on the success screen.
FailedData flowdata_connection_failedTriggers when the End result failed screen for a data connection loads.
Link a new accountData flowdata_new_accountTriggers when the user is on the success screen and clicks the button to link a new account.
MFA Select auth methodData flowdata_mfa_select_methodTriggers when the “Choose your MFA method” screen loads.
MFA Verify on bank appData flowdata_mfa_verify_on_bankTriggers when the verify on bank app screen loads.
MFA Validate with an offline PINData flowdata_mfa_validate_offlineTriggers when the user clicks to verify with an offline PIN.
Select bankData flowdata_bank_guaranty-trust-bankTriggers when the app saves the name of the bank the user chooses.
SuccessData flowdata_nuban_verify_successfulTriggers when the user is on the success screen after verifying their nuban.
FailedData flowdata_nuban_verify_failedTriggers when the user is on the End result failed screen for a nuban verification.
Specify your banking appData flowdata_bank_app_selectTriggers when the modal that prompts the user to select their banking app loads.
Nuban Verify attemptData flowdata_nuban_verify_attemptTriggers when the user clicks the continue button to confirm thier nuban.
Data MFA Security questionData flowdata_mfa_security_questionTriggers when the security question screen loads.

Payments events

These events give you information about user interaction and app events in the Payments flow.

Event nameFlow typeonEvent parameter nameEvent trigger
Select payment account typePaymentspayment_account_typeTriggers when the account type (business or personal) selection screen loads.
Select bankPaymentspayment_bank_selectionTriggers when the bank selection page loads.
Specify your banking appPaymentspayment_bank_app_selectTriggers when the modal that prompts the user to select their banking app loads.
Payment enter credentialsPaymentspayment_login_attemptTriggers when the user clicks the continue button to attempt to login.
Payment Account selectionPaymentspayment_select accountTriggers when the “Select your account” screen loads.
Payments MFA Security questionPaymentspayment_mfa_security_questionTriggers when the security question screen loads.
Payment successPaymentspayment_connection_successfulTriggers when the final success screen after the payment is complete loads.
Payment failedPaymentspayment_connection_failedTriggers when the failed connection screen after a failed payment connection loads.
Select bankPaymentspayment_bank_guaranty-trust-bankTriggers when the user selects a bank on the bank selection page.
Showing bank screenPaymentspayment_viewed_banksTriggers when the bank selection screen loads.
Login methodPaymentspayment_login_method_selectionTriggers when the app logs the login method the user chooses: internet or mobile banking.
MFA Verify on bank appPaymentspayment_mfa_verify_on_bankTriggers when the Verify in bank app screen loads.
MFA Validate with an offline PINPaymentspayment_mfa_validate_offlineTriggers when the user clicks to verify with an offline PIN.
Credentials screenPaymentspayment_login_screenTriggers when the account credentials entry screen loads.
Select bankPaymentspayment_select_bankTriggers when the user selects a bank on the bank selection page.

RUX events

These events give you information about user interaction and app events in the RUX (returning user experience) flow.

Event nameFlow typeonEvent parameter nameEvent trigger
RUX select account loadRUXrux_selectionThe user views a list of their existing banks.
Enter passwordRUXrux_enter_passwordTriggers when the Enter Password screen loads.
Link a new accountRUXrux_new_accountTriggers when the user clicks on the Add another account button.
No RUX accounts availableRUXrux_not_foundTriggers when the app finds no user accounts for the provided identification.
SuccessRUXrux_successfulTriggers when the success screen for RUX connections loads.
FailedRUXrux_failedTriggers when the failed connection screen for RUX connections loads.

Event Logs

The event logs on your Dashboard help you monitor and track user interactions in your Okra apps. Leverage these features to get a comprehensive insight into the activities of your users:

  • Filter for user IDs to check event logs related to a specific user.
  • Filter for event logs from a specific date or time period using the date picker.
  • Export event logs to CSV or JSON format. Select the events you want to export and the format you prefer, and the Dashboard will send the events in an email.

Sample event callback

{
  "event": true,
  "event_callback_url": "webhook.site/10097dhr-ef8c-00d3-86f8-894a010f5706",
  "event_data": {
    "tracking_id": "MN09uhhgd"
  },
  "event_location": "https://app.okra.ng/:ref/bank?bank=rubies-bank",
  "event_name": "USER_LOGIN_ATTEMPTED",
  "event_time": null,
  "event_type": "DATA_EVENT"
}

Was this page helpful?