Skip to main content

Before you begin

You will need the following to connect to the FrankieOne API,
  • Customer ID
  • Customer Child ID (Optional)
  • API key
If you don’t have any yet get in touch with our sales team . You must host Smart UI on your own webserver. FrankieOne doesn’t provide a hosted version yet. Supported Countries Below is a list of countries that are fully supported by the smart UI.
  • Australia
  • New Zealand
  • Indonesia
  • Thailand
  • Singapore Manual Input (not Singpass)
  • Generic International Passport
  • Generic International National ID
Future supported countries
  • USA
  • UK
  • All Others

Step 1: Create a session

Obtain a session on your backend and forward it to your frontend web page.

Construct the API credential

  1. Serialize your FrankieOne API credentials to a string using ’:’ as a separator.
  2. Encode the resulting string using Base64 encoding.
If you are using a macOS or Linux operating system, run the following command in a terminal:
Shell
If you have a child account with FrankieOne, modify the above command to the following:
Shell

Obtain a temporary session token

Send a POST request to the /auth/v2/machine-session endpoint.

Base URL

Use one of the following base URLs depending on the environment you are targeting. Note, Smart UI uses different URLs to FrankieOne’s server-side APIs.

Authorization header

Pass the encoded credential in the Authorization request header using machine as the scheme: Authorization: machine YOUR_ENCODED_CREDENTIAL

Request body

Include the following parameters in the body of the request: * Only provide either reference or entityId, not both.
Note
Applicant Reference with whitespace characters aren’t supported by the Smart UI and will be rejected. Let us know if this will prevent you from integrating.

Request example

The following example creates a session object for a user in the Demo environment:
Shell
Your Customer ID and API Key are both secret information and shouldn’t be included in the frontend code. For that reason, make sure to call the /auth/v2/machine-session endpoint from your backend server.
The /auth/v2/machine-session endpoint will respond with a 200 HTTP status code, indicating the session was created successfully. The response body will include a configuration object that’s used by Smart UI to customize its behavior. The configuration object includes a dictionary of strings that might seem like error messages, but they aren’t. You may ignore anything found in the successful response body.

Read the token from the response

The successful response will contain a response header named token that contains the authentication token required to configure Smart UI. This token is valid for only one hour, and within the Smart UI, it’s refreshed for another hour on each successful call to the backend server. The following example reads the token from the response:
JavaScript
Make sure to access the header by name token rather an numeric index, as the order in which the response headers are returned isn’t guaranteed to be the same for each request.

Step 2: Set up Smart UI

Install the Smart UI widget

Include the Smart UI script tag within the <head /> section of your HTML page.

Add the widget to your page

Smart UI is implemented as a Web Component. This means it’s a custom element whose internal structure and styles are isolated from your page. Add the custom <ff-onboarding-widget> element to your page where you would like it to be rendered:

Create initialization object

Create an object to initialize your Smart UI integration. This section shows the required and recommended parameters. View the Smart UI configuration reference for the full list of available parameters. Sample initialization object:
JavaScript

Initialize the Smart UI widget

Initialize Smart UI by calling the initialiseOnboardingWidget method on the global frankieFinancial object. The initialization needs to be done after the page is mounted/ready, so the HTML elements are available. The example below shows how to initialize Smart UI within the onload event.

Step 3: Test and go live

When you’re ready to use the API in production mode using live data, you will need a Production API Key. To get the API Key, please contact your onboarding team representative.

Next steps

Now that have have integrated Smart UI end-to-end, you may wish to: