# Overview

The Webauthn module is a part of a client-side JavaScript SDK. It allows you to easily log in users with biometrics based on the [WebAuthn APIs](/openapi/user/backend-webauthn.openapi). The SDK does all the heavy lifting to provide secure WebAuthn authentication while leaving you the flexibility to control the authentication logic and user experience.

## Benefits

The SDK offers many advantages over the APIs, including:

- Journey orchestration to support decisions and complex flows
- Client-side WebAuthn calls, along with data processing before and after
- Simplifies calls to Mosaic, reducing unnecessary complexity


## 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:


```js
// Import WebAuthn module
import { webauthn, initialize } from '@transmitsecurity/platform-web-sdk';

// Initialize SDK
// If SDK was loaded via script tag, use window.tsPlatform.initialize({ ... })
initialize({
  clientId: 'your-client-id',
  webauthn: {
    serverPath: 'https://api.transmitsecurity.io' // Required: Set serverPath based on your region or custom domain
  }
});
```

Note
If you're using a [custom domain](/guides/deployment/custom_domains) for your application, replace the default Transmit domain (`api.transmitsecurity.io`) with your custom domain in `serverPath` (for example, `https://your-domain.com` instead of `https://api.transmitsecurity.io`).

Customizations:

| Name | Type | Description |
|  --- | --- | --- |
| `serverPath` | `string` | (Required) The WebAuthn module should be configured to work with your region or custom domain by setting `serverPath` to: - `https://api.transmitsecurity.io` (for US)  - `https://api.eu.transmitsecurity.io` (for EU)  - `https://api.ca.transmitsecurity.io` (for Canada)  - `https://api.au.transmitsecurity.io` (for Australia)  - `https://api.sbx.transmitsecurity.io` (for sandbox)  - `https://<your_custom_domain>` (for custom domain) For the SDK modules to work properly together, the regions must match. |
| `webauthnApiPaths?` | [`WebauthnApis`](/sdk-ref/authnsdk/interfaces/webauthnapis) | Override endpoints when using a proxy server in case the proxy server implements its own paths. |


For more information, refer to the class reference, as well as the [Quick start guide](/guides/webauthn/quick_start_sdk).

style

table th:first-of-type {
    width: 20%;
}
table th:nth-of-type(2) {
    width: 15%;
}
table th:nth-of-type(3) {
    width: 65%;
}