Skip to main content

How it works

The user onboarding flow works as follows:
  1. User navigates to your registration page.
  2. Before serving the front-end, your server communicates with Frankie’s server to create a temporary session.
  3. Your server passes the session object to your front-end for it to initialize OneSDK using the session object.
  4. OneSDK modules are activated to handle the collection and processing of identity verification data.
  5. You verify the individual using OneSDK’s submit() method.
1

Create a session and forward it to your front-end

Construct the API credentials

  1. Serialize your FrankieOne API credentials to a string using the ’:’ separator.
  2. Encode the resulting string using Base64 encoding.
Run the following command:
Shell
JavaScript
If you have a child account with FrankieOne, modify the above command to the following:

Obtain a temporary session token

Send a POST request to the /machine-session endpoint of our Backend for Frontend server (BFF). The appropriate URL for BFF depends on the environment you’re integrating with:
Different Base URL”>
The base URL for the /machine-session endpoint is different to the server API.
Pass the encoded credential in the Authorization request header using machine as the scheme:Authorization: machine YOUR_ENCODED_CREDENTIALInclude the following parameters in the body of the request:| Parameter name | Required | Description |* Either entityId or reference is required, but not both.The following example creates a session object for a user using a unique customer reference:
Shell
JavaScript
Don’t publish your credentials to your front-end. They should remain accessible only from your server.
Sample response:
JSON

Pre-fill applicant data

If you use an existing reference or entityId when creating a session object, OneSDK will retrieve the existing data and pre-fill the applicant, and new information captured by the user will be updated to the same entity:
JavaScript
2

Set up OneSDK

Use OneSDK to onboard an individual into your application.

Install the SDK

We recommend installing OneSDK via a <script> tag so that your webpage always receives the latest, most up-to-date version.
Embed script
The URL below will point to the latest stable v1 version. Alternatively, you can point to a specific version by swapping out the v1 URL parameter with a specific major and minor version (i.e. v1.6.1-beta).
JavaScript
NPM Module
We’re working on enabling other frameworks such as Next.js, Vue, and React + Webpack.
Shell
Import the SDK into your application:
If you install OneSDK as an npm package, you are responsible for updating the version in your package.json file to ensure you always have the most up-to-date version.

Create a configuration object

Create an object for the global configuration of your SDK integration. This section shows the required and recommended parameters.Sample configuration:
Pass the entire object returned from the response of the /machine-session endpoint as the value for the session parameter. Don’t extract the token or any other field from the response.For example, your code may look like this:
JavaScript
JavaScript

Initialize the OneSDK object

Create an instance of OneSDK using the configuration object you created.The OneSDK function returns a promise, which can be await-ed in JavaScript ES2017’s await.
Otherwise, you can use Javascript’s Promise API.
3

Verify document details via OCR

Use the OCR Component provided by OneSDK to verify document details.

Create the OCR Component

Create an instance of the OCR Component by passing 'ocr' in component(type).
JavaScript

Obtain results

Listen to the results event to get notified when the OCR extracted results are available.

Handle errors

Listen to the error event to handle any errors from the OCR component. For example, the supplied image may not be processable.

Start the document capture flow

Finally, start the document capture flow by mounting the OCR component.
4

Verify biometrics

Use the Biometrics Component provided by OneSDK to verify the user’s facial image/video.You may skip this step if biometrics isn’t required in your onboarding flow.

Create the container element for the Biometrics component

Create a DOM container element on your onboarding web page where you want the component to be rendered. Make sure to give the container element a descriptive ID. The container element for Biometrics and OCR components can be the same.For example:
If you are using JavaScript frameworks such as Vue or React, make sure that you use references instead of selectors and that you don’t re-render the DOM element.

Create the Biometrics component

Create an instance of the Biometrics component by passing 'biometrics' in component(type, options?).
JavaScript

Obtain results

Listen to the results event to get notified when biometrics results are available.
JavaScript

Handle errors

Handle detection failed events
When the biometrics component fails to detect the user, it will emit a detection_failed event.You can re-attempt another capture by mounting the component again upon receiving the detection_failed event.
Listen to the error event to handle any other errors.

Start the biometrics flow

Mount the component
Finally, start the facial capture flow by mounting the component in your container element.

Get notified when the capture feed is ready

The component may take a moment to initialize and display the image/video capture feed. During this time you can optionally display your own loading state. Listen to the ready event to know when the biometrics capture feed is ready to use.
5

Submit information

Access the Individual object to represent the person being onboarded.
Make sure that the user consent has been added and then submit the information to verify the individual according to your recipe.