Available Library/SDK for Quick Integration
The Adhere Web SDK provides a seamless, secure way to verify user presence (Liveness) and match their identity against official documents. Our SDK handles the heavy lifting of frame capture, face extraction, secure transmission, and verification asynchronously.Getting started
To initialize the SDK, you will need:- Public API Key -
apiKey: Found in your Adhere Dashboard settings. - Configuration ID -
clientID: The unique ID for your specific liveness workflow.
Installation
For web applications, install our library via NPM.- Web: @smartcomply/web-sdk
- React-Native: (Upcoming)
Implementation
Create a Session Before initializing the SDK, your server must request a short-livedsessionToken.
-
Base URL:
https://adhere-api.smartcomply.com -
Endpoint:
POST {BASE_URL}/v1/sdk/sessions/create/ -
Header:
Authorization: Api-Key <YOUR_API_KEY> -
Body:
{"client_id": "<YOUR_SDK_CONFIG_ID>"} -
Content-Type:
application/json
token received into the SDK constructor. Initialize the verification engine by calling the sdk.launch() method. This launches a secure overlay that guides the user through the liveness challenges (e.g., blinking, head rotation) and document upload.
Callback Specifications
onSuccess(payload) Triggered when the session is successfully completed.| Property | Type | Description |
|---|---|---|
| data | SuccessDataType | The created liveness entry session. |
| status | Integer | 200 |
| message | String | Human-readable message |
| Property | Type | Description |
|---|---|---|
| error | Error | The error object |
| code | String | Unique error code: e.g. AUTH_ERROR, TIMEOUT_ERROR, ENTRY_CREATION_ERROR, SUBMISSION_ERROR, or UNKNOWN_ERROR. |
| message | String | Human-readable explanation of the error. |
Webhook Integration
Since face matching involves complex asynchronous processing, the final result is sent to your server via a Webhook.Payload Schema
When the verification is complete, Adhere will send a POST request to your configured Webhook URL. Sample JSON PayloadField definitions
| Field | Description | Type |
|---|---|---|
status | The status of the session (passed, failed, expired). | string |
is_verified | Whether we successfully matched the selfie to the ID. | boolean |
match_score | The “Distance” between faces. Lower is better. Facenet threshold is 0.40. | float |
entry_id | Unique identifier for this verification record. | String |
Explaining the Match Score (Distance)
Match score is a measure of “how different” two faces are. It is represents the mathematical distance between the selfie and the ID. A lower score indicates a higher probability of a match. While our system flags is_verified: true for any score below0.40, we recommend a manual audit for any scores falling in the Borderline range (0.40 - 0.50) to account for extreme lighting or age differences in documents.
| Score Range | Interpretation | Action Recommended |
|---|---|---|
| 0.0 - 0.25 | Identical match | Auto-Approve |
| 0.25 - 0.40 | Strong match | Auto-Approve |
| 0.40 - 0.50 | Borderline match | Manual Review |
| 0.50+ | Different people | Reject |
Security & Best Practices
Verify the Source - Webhook Signatures
To ensure that webhook requests are coming from Adhere, we include anX-Adhere-Signature in the header of every request. You should verify this signature before processing the data.
Verification Steps
-
Retrieve your
webhook_secretfrom the Adhere Dashboard. - Get the raw body of the POST request.
- Compute the HMAC hex digest using the SHA256 hash function and your secret key.
-
Compare your computed signature with the one in the
X-Adhere-Signatureheader.