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: OutcomeHow it works
- Your backend creates a session and returns its
sessionIdandaccessTokento the browser. - The browser renders
VerifyVerifierwith those credentials; the component talks directly to the VerifEye Service to capture and verify. - When the flow finishes,
onVerificationCompletedfires with thesessionId. - Your backend fetches the result for that
sessionIdand decides what happens next (e.g. allow sign-up).
Learn more:
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
endHow it works
- The first check enrols the user and remembers their
faceIdas the reference. - On an interval, your backend creates a fresh session and the browser mounts
VerifyVerifierwithheadlessenabled to capture and verify silently. - 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). - The cycle repeats until you stop it (for example after a time limit or when the user leaves).
Learn more:
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.
For continuous verification, add this to the prompt: "Run the SDK in headless mode (the headless prop, no built-in UI), create a fresh session for each check on an interval, and compare the faceId returned each cycle to the first one to decide whether it is still the same person."
Last updated: 2026-06-23