> ## Documentation Index
> Fetch the complete documentation index at: https://docs.authmatech.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authmatech Web SDK Reference (authmatech-sdk-web)

> Integrate silent, no-OTP mobile verification in the mobile browser with the Authmatech Web SDK — install authmatech-sdk-web, run a check with a transaction id, and verify on your backend.

The Authmatech Web SDK (`authmatech-sdk-web`) runs silent mobile verification in the **mobile browser**. It is **client-side only** — you give it a transaction id and a check URL, it runs the silent network check, and your backend completes the verification with the server-side API key. The SDK never holds your API key.

For the end-to-end integration (including your backend), see [Web verification](/guides/web-verification).

<Note>
  The Web SDK is built for **mobile browsers** on a mobile-data connection. Desktop browsers and Wi-Fi/VPN connections can't complete the silent check — plan a fallback, such as manual entry or retrying on mobile data.
</Note>

## Install

```bash theme={null}
npm install authmatech-sdk-web
# or: yarn add authmatech-sdk-web
```

Current version: **1.0.3**. The page must be served over **HTTPS**.

## Usage

### ES module (Webpack, Rollup, Vite, etc.)

```js theme={null}
import { initAuthmatechCheck } from 'authmatech-sdk-web';

// 1) A transaction id for this verification.
//    Format: prefix-<UUIDv4>. The prefix is provided by Authmatech.
const transactionId = 'prefix-550e8400-e29b-41d4-a716-446655440000';

// 2) Run the silent check. checkUrl is provided by Authmatech.
initAuthmatechCheck({
  transactionId,
  checkUrl: 'https://web.authmatech.com/verify',
});
```

### UMD bundle (`<script>` tag)

```html theme={null}
<script src="https://cdn.jsdelivr.net/npm/authmatech-sdk-web/dist/authmatech-sdk-web.umd.min.js"></script>
<script>
  AuthmatechSDKWeb.initAuthmatechCheck({
    transactionId: 'prefix-550e8400-e29b-41d4-a716-446655440000',
    checkUrl: 'https://web.authmatech.com/verify',
  });
</script>
```

## API

### `initAuthmatechCheck(config)`

Runs the silent verification check for the given transaction over the device's mobile-data connection.

<ParamField path="transactionId" type="string" required>
  The transaction id for this verification, in the format `prefix-<UUIDv4>`. The prefix is provided by Authmatech for your account; generate the UUID per verification.
</ParamField>

<ParamField path="checkUrl" type="string" required>
  The verification URL for your account, provided by Authmatech. Must use `https`.
</ParamField>

The call **throws** if:

* `transactionId` is missing or empty.
* `checkUrl` is missing, invalid, or not using the `https` protocol.

<Note>
  The SDK stores no personal data and keeps nothing in local storage. It does not return the confirmed number to the browser — your backend resolves the result by transaction id (next section).
</Note>

## Completing the verification

The Web SDK runs the silent check; your **backend** turns it into a verdict. Call [`POST /v1/api/verify/{transactionId}`](/guides/web-verification) with the same `transactionId` and the `X-API-KEY` + `X-CLIENT-ID` headers:

```bash theme={null}
curl -X POST "https://service.authmatech.com/v1/api/verify/prefix-550e8400-e29b-41d4-a716-446655440000" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "X-CLIENT-ID: YOUR_CLIENT_ID" \
  -H "Content-Type: application/json" \
  -d '{ "mobileNumber": "+962791234567", "serviceType": "LOGIN" }'
```

```json theme={null}
{ "success": true, "messages": [{ "type": "SUCCESS", "httpStatus": "OK" }], "data": { "validNumber": true } }
```

## Related

<CardGroup cols={2}>
  <Card title="Web verification guide" icon="qrcode" href="/guides/web-verification">
    The full browser + backend flow, end to end.
  </Card>

  <Card title="API: verify (Web)" icon="code" href="/api/overview">
    Resolve a verification by transaction id.
  </Card>
</CardGroup>
