Skip to main content
The Web SDK renders a camera view, guides the user, captures a frame from the live stream (never a file upload), and submits it with anti-injection signals. Your page receives a callback with the session id — the decision stays server-side where only your backend can read it. Requires a browser with camera access over HTTPS. You need a clientToken (sst_…) minted by your backend before mounting the SDK.

Installation and Usage

The Completion Callback

onError receives { code, message } using the standard error codes — for example, SESSION_EXPIRED means you should mint a fresh session. Retryable 422 errors are handled inside the SDK’s built-in retake flow and never surface as onError calls.

Behavior Notes

  • The SDK calls GET /v1/verification_sessions/session_info at mount to validate the token and fetch the session nonce before opening the camera — an expired or already-used session fails fast with no camera prompt.
  • Retakes for user-fixable problems (no face detected, blur, backlight) are built in, up to the session’s 3-attempt limit.
  • The SDK never exposes scores or decisions to the page. Always verify the outcome server-side.
Prefer zero frontend code? Use the hosted page — it runs the same capture flow, served from SpoofSense’s origin, with no SDK to install.