Run silent, no-OTP mobile verification in the browser end to end with the Authmatech Web SDK — header enrichment, session registration, and backend verify.
This guide wires up silent verification in a web app, end to end: the browser runs header enrichment with the Web SDK, your backend completes the verification with the server-side API key, and the customer is recognized with nothing to type.
The golden rule: the API key never leaves your server. The browser uses a short-lived sdkToken; your backend uses the X-API-KEY.
In the SDK, the encrypted proof is called authmatechCode and the operator id is MNOID. On the Verify API these map to encryptedMobileNumber and operatorId respectively.
import { AuthmatechWebSDK, maskAuthmatechCode } from 'authmatech-sdk-web';const sdk = new AuthmatechWebSDK({ backendBaseURL: 'https://service.authmatech.com', clientId: process.env.NEXT_PUBLIC_AUTHMATECH_CLIENT_ID!, sdkToken: sdkTokenFromYourBackend, // short-lived, fetched per session});const { authmatechCode, MNOID, sdkSessionId } = await sdk.startHeaderEnrichment({ heUrl: 'https://he.operator.example.com/check' });// Only ever display the masked value. The raw authmatechCode goes// to YOUR backend over TLS — never to logs or analytics.console.log('identity:', maskAuthmatechCode(authmatechCode));await fetch('/api/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ authmatechCode, MNOID, sdkSessionId, mobileNumber }),});
Under the hood, startHeaderEnrichment registers the session by calling POST /v1/api/sdk/session with the X-SDK-TOKEN and X-CLIENT-ID headers, then returns the sdkSessionId you forward to your backend.
Header enrichment needs an active mobile data connection. On Wi‑Fi, VPN, or some roaming networks the SDK throws (for example sdk_no_he_result). Catch it and fall back gracefully:
try { const id = await sdk.startHeaderEnrichment({ heUrl }); // ...verify} catch (err) { // Show manual entry and route the customer through Stuck+ showManualUnlock();}
See Stuck+ for recovering these customers without dropping back to an OTP.