Developer Guide
The Authentikare SDK for JavaScript is a client-side library that allows you to integrate the Authentikare verification process into your website. The SDK provides a simple and secure way to verify the identity of your users, ensuring that they are who they claim to be.
Two types of verification are available:
To initiate the integration process and obtain a valid session_id, the external website needs to make a server-to-server call to the following endpoint:
POST https://mytenant.authentikare.com/app/api/v1/create-session
curl --location 'https://mytenant.authentikare.com/app/api/v1/create-session' \ --header 'Content-Type: application/json' \ --data '{ "external_id": "a20cf480-c657-4c41-8630-3e97097a56d3", "webhook": "https://some.external.website.domain.com/", "phone": "+12345657999", "type": "liveness", "credentials": "secret" }'
curl --location 'https://mytenant.authentikare.com/app/api/v1/create-session' \ --header 'Content-Type: application/json' \ --data '{ "external_id": "a20cf480-c657-4c41-8630-3e97097a56d3", "webhook": "https://some.external.website.domain.com/", "phone": "+12345657999", "type": "id-check", "scopes": ["over_18"], "credentials": "secret" }'
{ "data": { "session_id": "" } }
The response includes the following property:session_id. A valid session_id serves as a signature for subsequent interactions during the integration process. The external website needs to securely store this session_id for further use.
{ "error": { "message": "invalid credentials", "status": 401 } }
In case of an error, the server will respond with an appropriate HTTP status code and an error message in the response body, allowing the external website to handle the error accordingly.
To initialize the Authentikare SDK, the external website needs to include the following script tag in the head section of the HTML file:
<script type="text/javascript" src="https://mytenant.authentikare.com/app/websdk.js"></script>
The external website also needs to include the following link tag in the head section of the HTML file:
<link href="https://mytenant.authentikare.com/app/static/css/websdk.css" media="" rel="stylesheet" type="text/css">
To start the process, the external website needs to call the following function:
<script type="text/javascript"> Authentikare.init(session_id, { onComplete: () => void, // When the process completes or the Authentikare modal closes onSessionInvalid: () => void, // When the session does not exist or is invalid appType: "liveness" | "id-check", language: "fr"|"en" }); </script>
Make sure to replace session_id with the actual value you received from the backend during the initialisation process.
The function will open a modal window with the Authentikare SDK for JavaScript, allowing the user to complete the verification process.
Once the verification process has been completed, our system will send the results back to the external website using a webhook, a backend-to-backend communication that allows to deliver the outcome of the process.
In the case of a successful verification, Authentikare will send an HTTP POST request to the specified webhook URL of the external website. The request will include the following information in the request body:
{ "data": { "session_id": "788743f0-f355-4bea-9a85-68ff36804ef1", "external_id": "aaaaa", "status": "succeed", "details": { // if scope was requested "over_18": true|false }, "notify_via_sms": true } }
The details field contains an object of the traits that have been verified successfully, such as age, gender, hair color, and visible tattoos. The notify_via_sms field represents the Boolean value of the phone toggle.
If the verification process is declined for any reason, Authentikare will send an HTTP POST request to the webhook URL with the following payload:
{ "data": { "session_id": "788743f0-f355-4bea-9a85-68ff36804ef1", "external_id": "aaaaa", "status": "declined", "reason": ["instructions_not_followed", "underage"], "notify_via_sms": false } }
The reason field contains an array of reasons indicating why the verification was declined, such as "instructions not followed," "under age," or "low quality video/audio." The notify_via_sms field represents the Boolean value of the phone toggle.
We appreciate your interest in our app. In case of feedback our questions contact us at: [email protected] .
Updated on 24/11/2023