Web Integration (Beta)
Documentation for Integrating with Smile Identity on the Web
Web Integration currently supports only Enhanced KYC + SmartSelfie™, other products will be added soon.
The web Integration Widget is a client-side component that your web site or web application can use to have your users verify their identity with Smile Identity. The web integration widget is a hosted solution and handles the image capture, user consent, job submission and error handling for the product you are want to run.

Guide

  • Set up a callback endpoint
  • Choose a Server to Server Library
  • Create an endpoint for the web token
  • Install the Web Integration
  • Use the Web Integration

Set Up a Callback Endpoint

All jobs using the Web Integration are asynchronous. As such, having a Callback Endpoint in your Server is important.
Here's our guide on how to set up a callback endpoint.

Choose a Server to Server Library

We currently have Server to Server Libraries in the following languages / run-times.
In this documentation, our code samples will use the NodeJS Server to Server library.

Create an EndPoint for the Web Token

Using your chosen Server to Server library, create an endpoint for fetching a token.
This is our sample NodeJS script that uses our NodeJS Server-to-Server library.
1
const express = require('express');
2
const { v4: UUID } = require('uuid');
3
const cors = require('cors');
4
5
if (process.env.NODE_ENV === 'development') {
6
const dotenv = require('dotenv');
7
8
dotenv.config();
9
}
10
11
const SIDCore = require('smile-identity-core');
12
const SIDWebAPI = SIDCore.WebApi;
13
14
const app = express();
15
16
app.use(cors());
17
app.use(express.json({ limit: '500kb' }));
18
19
// NOTE: you can make this endpoint use the `POST` method,
20
// and pass a User ID, Job ID, or Product Type from your system.
21
app.get('/token', async (req, res, next) => {
22
try {
23
const { PARTNER_ID, CALLBACK_URL, API_KEY, SID_SERVER } = process.env;
24
const connection = new SIDWebAPI(
25
PARTNER_ID,
26
CALLBACK_URL,
27
API_KEY,
28
SID_SERVER
29
);
30
31
const request_params = {
32
user_id: `user-${UUID()}`,
33
job_id: `job-${UUID()}`,
34
product: 'ekyc_smartselfie', // NOTE: This is the only supported product at this time
35
callback_url: CALLBACK_URL
36
};
37
38
const result = await connection.get_web_token(
39
request_params
40
);
41
42
res.json(result);
43
} catch (e) {
44
// handle error
45
console.error(e);
46
}
Copied!
This is all the Server-Side configuration needed for the Web Integration.

Install the Web Integration

Read more in the Installation page

Use the Web Integration

Read more in the Usage page
Last modified 12d ago