# Overview

Identity Verification is a module of a client-side JavaScript SDK that allows you to verify IDs and selfies with Mosaic.

## Installation

Load the SDK:

npm
```bash
npm install @transmitsecurity/platform-web-sdk@^2
```

yarn
```bash
yarn add @transmitsecurity/platform-web-sdk@^2
```

script tag
```html
<script src="https://platform-websdk.transmitsecurity.io/platform-websdk/2.x/ts-platform-websdk.js" id="ts-platform-script"></script>
```

## Initialization

To initialize, use the following code:

Note
Identity Verification module requires the Fraud Prevention module to be imported and initialized.

```js
import { idv, drs, initialize } from '@transmitsecurity/platform-web-sdk';

// Initialize SDK
// If SDK was loaded via script tag, use window.tsPlatform.initialize({ ... })
initialize({
  clientId: 'your-client-id',
  idv: {
    serverPath: 'https://api.transmitsecurity.io/verify', // Required: Set serverPath based on your region or custom domain
    consentVersion: 'CONSENT_VERSION', // ID of the consent document
    callbacks: callbacks // Callback methods
  },
  drs: {
    serverPath: 'https://api.transmitsecurity.io/risk-collect/', // Required: Set serverPath based on your region or custom domain
  }
});
```

Customizations:

| Name | Type | Description |
|  --- | --- | --- |
| `serverPath` | `string` | (Required) The Identity Verification module should be configured to work with your region or custom domain by setting `serverPath` to: - `https://api.transmitsecurity.io/verify` (for US)  - `https://api.eu.transmitsecurity.io/verify` (for EU)  - `https://api.ca.transmitsecurity.io/verify` (for Canada)  - `https://api.au.transmitsecurity.io/verify` (for Australia)  - `https://api.sbx.transmitsecurity.io/verify` (for sandbox)  - `https://<your_custom_domain>/verify` (for custom domain) For the SDK modules to work properly together, the regions must match. |
| `consentVersion` | `string` | ID of the consent document. |
| `callbacks` | `object` | Callback methods for handling verification events. |
| `language` | `string` | Language code for the SDK UI (e.g., `'en'`). |
| `rootElement` | `string` | ID of the root container element for the SDK UI. |