authmatech-sdk-web) runs silent mobile verification in the browser. It performs mobile-network header enrichment, registers a session with Authmatech using a short-lived SDK token, and returns an identity result your backend uses to complete verification. The SDK is designed so your API key never touches client code.
For the end-to-end integration (including your backend), see Web verification.
Install
Configure
The Authmatech API base URL. Must be HTTPS.
Your public Client ID. Sent as
X-CLIENT-ID.A short-lived, browser-scoped token your backend issues per session. Sent as
X-SDK-TOKEN. It can only call /v1/api/sdk/session — never the server APIs.Verbose logging for development.
If session registration fails, allow the flow to continue without an
sdkSessionId. Off by default.Methods
startHeaderEnrichment(options)
Runs the full flow — enrichment, then session registration — and resolves with the identity result.
AuthmatechIdentityResult:
Forward
authmatechCode, MNOID, and sdkSessionId to your backend, which calls POST /v1/api/verify with the API key. Map authmatechCode → encryptedMobileNumber and MNOID → operatorId.registerSession(input)
Registers a session for an identity you already hold, returning { sdkSessionId }. startHeaderEnrichment calls this for you; use it directly only for advanced flows.
getVersion()
Returns the SDK version string.
maskAuthmatechCode(code)
A helper export that returns a masked, display-safe form of the identity token. Only ever show the masked value in UI or logs.
Safe display
Error handling
The SDK throwsAuthmatechSDKException with a stable ErrorCode:
| Code | Meaning |
|---|---|
sdk_invalid_config | Constructor input failed validation |
sdk_invalid_he_url | heUrl missing, malformed, or non-HTTPS |
sdk_he_request_failed | Operator enrichment returned a non-2xx status |
sdk_no_he_result | Operator returned 200 but no identity token (often Wi‑Fi/VPN) |
sdk_invalid_operator_response | Operator error code or malformed body |
sdk_session_registration_failed | Authmatech rejected the session |
sdk_timeout | Request exceeded the timeout (default 8000 ms) |
sdk_network_error | fetch failed (CORS, mixed content, DNS, …) |
Related
Web verification guide
The full browser + backend flow.
API: SDK session
The endpoint the SDK registers against.