For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to Integrate Hypersign ID Widget In your App?

How to integrate Hypersign ID Widget

This document is a comprehensive integration guide for developers embedding the pre-built Hypersign KYC ID Widget into their web applications. By utilizing the pre-built widget, you can deploy a secure, compliant, and conversion-optimized identity verification flow with minimal development effort, while leaving the heavy lifting of biometric processing and decentralized identity (DID) registration to Hypersign's backend.

1. Integration Architecture

  • Backend Application: Securely manages your administrative API_SECRET keys, handles short-lived orchestration tokens, maps user profiles to Decentralized Identifiers (DIDs), and manages session instantiation.

  • Hypersign ID Widget: A pre-built, optimized UI overlay hosted by Hypersign that seamlessly manages user-facing permissions, camera captures, automated OCR extraction, liveness detection, and zero-knowledge signature generation.

  • Frontend Application: Initializes the client-side session handshake, embeds the Hypersign ID Widget popup container, and listens for real-time interface messaging events (such as session termination or validation errors) to seamlessly update your app's user interface.


+--------------------------------------------------+          +------------------+          +--------------------------------+
|                  Client Browser                  |          |  Your Backend    |          | Hypersign  Verification Service|
+--------------------------------------------------+          +------------------+          +--------------------------------+
|  Host Application   |    Hypersign ID Widget     |          |                  |          |                                |
+---------------------+----------------------------+          +------------------+          +--------------------------------+
           |                        |                           |                                       |
           | -- [1. Fetch Session & Session JWTs] ------------->|                                       |
           |                        |                           | -- [2. Authenticate & Create DID] --->|
           |                        |                           | <-- [3. Return App/User Tokens] ------|
           | <– [4. Mount Widget with Secure Tokens] -----------|                                       |
           |                        |                                                                   |
           |                        | ---- [5. Orchestrate Captures, Biometrics & ZK Proofs] ---------->|
           |                        |                                                                   |
           |                        |                           |<-- [6. Fire Webhook (Done)] ----------|

2. Base Configuration

Service URLs

Initialize the base endpoints for the Hypersign and credential routing services:

Prerequisite Setup

  1. Dashboard Access: Login to Hypersign Dashboard and go through onboarding flow to setup your ID verification tenant.

  2. Environment Secrets: Securely generate and download your SSI_API_SECRET and KYC_API_SECRET keys from the App Settings view. Store these in your backend .env configuration file.

  3. Issuer Information: Copy your application's unique decentralised identifier configuration from the SSI sub-portal:

    1. Sample DID and Verification Method IDs

      1. X_ISSUER_DID : did:hid:z6MkmEFC8N1AUsinEBNSszXoepHb45p38ZwidV58r1HPqCkU

      2. X_ISSUER_VERMETHOD_ID :did:hid:z6MkmEFC8N1AUsinEBNSszXoepHb45p38ZwidV58r1HPqCkU#key-1

      3. Please make sure that X_ISSUER_VERMETHOD_ID is of type Ed25519VerificationKey2020

You can keep these variables in your .env

3. Backend Implementation (Node.js)

The backend acts as an authenticated proxy layer. Under no circumstances should administrative API secrets be exposed to client-side code.

STEP 1: Prepare Administrative Access Tokens

Administrative Bearer tokens for KYC and SSI services must be cached locally and refreshed automatically only upon token expiration.

STEP 2: Register or Fetch User DID

Every user identity journey requires a unique Decentralized Identifier (DID) to cryptographically sign verification payloads.

⚠️ Ensure that your data workflow enforces a strict 1:1 mapping between a single user profile (e.g., unique internal user ID/email) and their generated DID entity.

STEP 3: Initialize the KYC Verification Session

Instantiate a remote verification journey record state block.

Session Lifespan: KYC state tracks a maximum validity window of 24 hours.

STEP 4: Generate User-Specific Bearer Token

Issue highly restricted, temporary user token for the frontend widget that can only be used to complete the current user's specific KYC session.

User's claims field MUST contain did and email fields

STEP 5: Composite Orchestration Route

Expose a single unified endpoint to provision the client onboarding setup details:

4. Frontend Implementation

Step 1: Client Workspace Handshake

Query your secure application backend domain endpoints to collect the runtime authorization variables.

Step 2: Render & Orchestrate Verification Window

Build the Widget URL with the required security tokens and embede in your frontend

Widget URL Format: https://verify.hypersign.id?kycAccessToken=<kycAccessToken>&ssiAccessToken=<ssiAccessToken>&sessionId=<sessionId>&kycUserAccessToken=<kycUserAccessToken>

Step 3: Invoking the widget

You can invoke the Hypersign KYC widget through popup from your page

Step 4: Listening to Widget Events

The Hypersign KYC Widget communicates with your application using the browser's window.postMessage() API.

Once a verification session completes (either successfully or with an error), the widget emits an event that your application can listen for. This allows you to update your UI, redirect users, or handle verification failures.

Note: A successful widget event (VERIFICATION_SUCCESS) indicates that the user has successfully completed the verification flow in the widget. Final verification results should always be confirmed using your configured webhook or by fetching the verification session via the API.

Event Payload

Every event emitted by the widget follows the same structure.

Field
Type
Description

status

string

Indicates whether the event is a success or error.

code

string

Machine-readable event or error code.

message

string

Human-readable description of the event.

Success Event

Error Event

Error Codes

The widget may emit the following error codes.

Code
Description

SESSION_EXPIRED

The verification session has expired. Create a new session and restart the verification flow.

ACCESS_TOKEN_EXPIRED

The widget access token has expired. Generate a new token before launching the widget again.

LIVELINESS_VERIFICATION_FAILED

Face liveness verification failed. The user should retry the biometric verification.

DOCUMENT_VERIFICATION_FAILED

The uploaded identity document could not be verified.

ZK_PROOF_GENERATION_FAILED

An unexpected error occurred while generating the cryptographic proof. Please retry the verification.

5. Webhook Integration

Step 1: Expose Webhook Route

To consume async confirmation messages emitted by the Hypersign verification services engine, map a public endpoint inside your backend router.

Configure your route location setup (e.g., https://yourdomain.com/api/v1/webhook/kyc) in the Hypersign ID Dashboard under Webhook Configurations.

Webhooks work via a Fire-and-Forget architectural notification strategy. When an evaluation lifecycle phase registers adjustments, the server pushes identity signatures containing data reference points directly to your destination handler:

Expected Webhook Payload Structure

Step 3: Implement Webhook Listener and Token Verification

Upon receiving the payload, make a back-channel request using your kycAccessToken to download the fully verified data packet structures.

Example consentDataResponse for Proof Of Age consent

Troubleshooting

Problem

The verification widget does not open.

Solution

Most browsers block popups that are not triggered by a user action. Launch the widget only in response to a button click or another direct user interaction.


Session Expired

Error Code

SESSION_EXPIRED

Cause

The verification session has expired (sessions are valid for 24 hours).

Solution

Create a new verification session by calling the Session API and launch the widget again.


Access Token Expired

Error Code

ACCESS_TOKEN_EXPIRED

Cause

The KYC or SSI administrative access token has expired.

Solution

Generate a new administrative access token using your API Secret and retry the request.


Document Verification Failed

Error Code

DOCUMENT_VERIFICATION_FAILED

Cause

The uploaded document could not be verified.

Possible Reasons

  • Blurry image

  • Unsupported document

  • Partial document capture

  • Damaged document

Solution

Ask the user to upload a clearer image or capture the document again.


ZK Proof Generation Failed

Error Code

ZK_PROOF_GENERATION_FAILED

Cause

The widget failed while generating the zero-knowledge proof.

Solution

Retry the verification. If the issue persists, contact Hypersign Support.


Webhook Not Received

Possible Causes

  • Incorrect webhook URL

  • Endpoint is not publicly accessible

  • Server returned a non-2xx response

  • Firewall blocked the request

Solution

  • Verify the webhook URL configured in the Hypersign Dashboard.

  • Ensure the endpoint is publicly accessible.

  • Verify your server responds with HTTP 200.


User Closed the Widget

If the user closes the popup before completing verification, simply allow them to launch the widget again.

The current verification session remains valid until it expires.

Last updated