Web SDK Use Cases

These use cases show two common ways to run identity verification directly inside your web application with the Web SDK.

In both, the responsibilities are the same: your backend creates the session (using your API key), the browser runs the verification with the VerifyVerifier component, and your backend reads the result. Your API key never reaches the client.


Embedded verification

What it is — a one-off identity check embedded directly in a page of your app, for example at sign-up or login. The user completes a single guided flow (consent → camera → liveness → capture) without leaving your application, and you read the outcome once it finishes.

Data flow

sequenceDiagram
    participant B as Browser (your app + Web SDK)
    participant S as Your Server
    participant V as VerifEye Service
    B->>S: Start verification
    S->>V: Create session (API key)
    V-->>S: sessionId + sessionToken
    S-->>B: sessionId + accessToken
    B->>V: Run verification (camera, liveness, capture)
    V-->>B: Verification completed
    B->>S: Request result (sessionId)
    S->>V: Get session result (API key)
    V-->>S: Result
    S-->>B: Outcome

How it works

  1. Your backend creates a session and returns its sessionId and accessToken to the browser.
  2. The browser renders VerifyVerifier with those credentials; the component talks directly to the VerifEye Service to capture and verify.
  3. When the flow finishes, onVerificationCompleted fires with the sessionId.
  4. Your backend fetches the result for that sessionId and decides what happens next (e.g. allow sign-up).

Learn more:

Web SDK
../
Create Session
../../verifeye-service-api/#create-session


Continuous verification

What it is — repeatedly re-verifying the same user in the background while they keep using your app, for example to confirm the same person stays present throughout a session. It uses the SDK's headless mode, so each check runs silently on an interval with no full-screen UI.

Data flow

sequenceDiagram
    participant B as Browser (your app + Web SDK, headless)
    participant S as Your Server
    participant V as VerifEye Service
    loop Every few seconds
        B->>S: Start check
        S->>V: Create session (API key)
        V-->>S: sessionId + sessionToken
        S-->>B: sessionId + accessToken
        B->>V: Silent capture + verify
        V-->>B: Verification completed
        B->>S: Request result (sessionId)
        S->>V: Get session result (API key)
        V-->>S: Result (faceId)
        S-->>B: Outcome
        Note over B: Compare faceId to the enrolled face<br/>→ verified / different / failed
    end

How it works

  1. The first check enrols the user and remembers their faceId as the reference.
  2. On an interval, your backend creates a fresh session and the browser mounts VerifyVerifier with headless enabled to capture and verify silently.
  3. Each completed check returns a faceId, which you compare to the reference to mark the cycle verified (same person), different (someone else), or failed (no usable result).
  4. The cycle repeats until you stop it (for example after a time limit or when the user leaves).

Learn more:

Headless verification
../#headless-verification
Create Session
../../verifeye-service-api/#create-session


Example coding prompt

Building with an AI coding assistant? Copy the prompt below into your assistant (Claude, Cursor, etc.). It gives the assistant the context it needs to integrate the Web SDK correctly. Fill in the placeholders in [brackets] first.

I want to integrate the VerifEye Web SDK (`@realeyes/verifeye-sdk`) into my app to run an
identity verification. Please implement it for my stack described below.

How the SDK works:
- It is a React component library; the single entry point is the `VerifyVerifier` component.
- Flow: my BACKEND creates a verification session with my secret API key and returns a
  session id + short-lived token to the browser; the BROWSER renders `VerifyVerifier` to run
  the verification; my BACKEND then fetches the result.
- SECURITY: the API key must NEVER reach the browser. Only the backend talks to the VerifEye
  Service with the API key; the browser only receives the short-lived session token.

Backend — create a session (do this server-side):
- POST https://verifeye-service-api-[eu|us].realeyes.ai/v1/verification/create-session
- Header: Authorization: ApiKey [MY_API_KEY]
- Body:
  ```json
  {
    "verifierConfigs": {
      "liveness": { "type": "Verification", "challengeType": "Balanced" },
      "age": { "type": "CalculationOnly" },
      "gender": { "type": "CalculationOnly" }
    }
  }
  ```
- Response: { "verificationSessionId": "...", "sessionToken": "..." }
- Expose an endpoint that calls this and returns verificationSessionId + sessionToken to the browser.

Frontend — render the component:
  ```tsx
  import { VerifyVerifier } from "@realeyes/verifeye-sdk";

  <VerifyVerifier
    sessionId={verificationSessionId}
    accessToken={sessionToken}
    region="[eu|us]"
    onVerificationCompleted={(sessionId) => { /* ask my backend for the result */ }}
    onServiceError={(operation) => { /* handle errors */ }}
  />
  ```

Backend — read the result (after onVerificationCompleted fires):
- GET https://verifeye-service-api-[eu|us].realeyes.ai/v1/verification/get-session-result?verificationSessionId=[id]
- Header: Authorization: ApiKey [MY_API_KEY]
- Returns the outcome (verificationResult, faceId, estimatedAge, etc.).

Requirements:
- Install: npm install @realeyes/verifeye-sdk
- Dependencies my app must have: react, react-dom
- The SDK uses the camera, so it must run over HTTPS (or localhost).
- The SDK shows its own consent screen by default — keep it unless my app already collects
  camera/biometric consent.

My stack: [DESCRIBE YOUR FRONTEND FRAMEWORK + BACKEND LANGUAGE/FRAMEWORK].
Please add the backend endpoints (create session + get result) and a frontend screen that runs
the verification and shows the outcome.

Last updated: 2026-06-23