# Migration to v2.x

This guide helps you migrate your Platform SDK integration from version 1.x to version 2.x.

Important
Platform SDK v1 has reached end-of-life (EOL) and will no longer receive updates, including security patches and bug fixes. All customers are strongly advised to upgrade to v2.x. For details, see [Changelog](/sdk-ref/platform/changelog).

## What's new

Version 2 introduces several improvements to the SDK architecture and configuration.

**Breaking changes**:

- The `serverPath` parameter becomes mandatory for all SDK modules.
- Fraud Prevention is disabled by default and must be explicitly initialized.
- Deprecating Fraud Prevention functions: `unidentifiedUser()`, `identifyUser()` and `setUser()`.
- Webauthn methods were refactored to use a single parameter object pattern instead of multiple positional parameters.


**Changes**:

- The Orchestration (IDO) module now uses separate typing files.


## Migrate your app to SDK v2.x

### Step 1: Add serverPath to all modules

The `serverPath` parameter is now **mandatory** for all SDK modules. Review all `initialize()` calls and add `serverPath` for each module you use.

**Before (v1):**


```js
await initialize({
  clientId: 'your-client-id',
  ido: {
    // serverPath was optional, defaulted to US region
  }
});
```

**After (v2.x):**


```js
await initialize({
  clientId: 'your-client-id',
  ido: {
    serverPath: 'https://api.transmitsecurity.io/ido' // Required
  }
});
```

Use the appropriate `serverPath` for your environment:

Orchestration
| Environment | serverPath |
|  --- | --- |
| US | `https://api.transmitsecurity.io/ido` |
| EU | `https://api.eu.transmitsecurity.io/ido` |
| Canada | `https://api.ca.transmitsecurity.io/ido` |
| Australia | `https://api.au.transmitsecurity.io/ido` |
| Sandbox | `https://api.sbx.transmitsecurity.io/ido` |
| Custom domain | `https://<your_custom_domain>/ido` |


Fraud Prevention
| Environment | serverPath |
|  --- | --- |
| US | `https://api.transmitsecurity.io/risk-collect/` |
| EU | `https://api.eu.transmitsecurity.io/risk-collect/` |
| Canada | `https://api.ca.transmitsecurity.io/risk-collect/` |
| Australia | `https://api.au.transmitsecurity.io/risk-collect/` |
| Sandbox | `https://api.sbx.transmitsecurity.io/risk-collect/` |
| Custom domain | `https://<your_custom_domain>/risk-collect/` |


Identity Verification
| Environment | serverPath |
|  --- | --- |
| US | `https://api.transmitsecurity.io/verify` |
| EU | `https://api.eu.transmitsecurity.io/verify` |
| Canada | `https://api.ca.transmitsecurity.io/verify` |
| Australia | `https://api.au.transmitsecurity.io/verify` |
| Sandbox | `https://api.sbx.transmitsecurity.io/verify` |
| Custom domain | `https://<your_custom_domain>/verify` |


WebAuthn
| Environment | serverPath |
|  --- | --- |
| US | `https://api.transmitsecurity.io` |
| EU | `https://api.eu.transmitsecurity.io` |
| Canada | `https://api.ca.transmitsecurity.io` |
| Australia | `https://api.au.transmitsecurity.io` |
| Sandbox | `https://api.sbx.transmitsecurity.io` |
| Custom domain | `https://<your_custom_domain>` |


### Step 2: Initialize Fraud Prevention explicitly

In v2.x, Fraud Prevention is disabled by default and must be explicitly initialized if your application relies on it. Add the `drs` module configuration to your `initialize()` call:

**Before (v1):**


```js
await initialize({
  clientId: 'your-client-id',
  // Fraud Prevention was initialized automatically
});
```

**After (v2.x):**


```js
await initialize({
  clientId: 'your-client-id',
  drs: {
    serverPath: 'https://api.transmitsecurity.io/risk-collect/' // Explicit initialization required
  }
});
```

### Step 3: Update renamed Fraud Prevention functions

If your application uses any of the following Fraud Prevention functions, update them to the new names:

| v1 function | v2.x function |
|  --- | --- |
| `unidentifiedUser()` | [`clearUser()`](/sdk-ref/platform/modules/drs#clearuser) |
| `identifyUser()` | [`setAuthenticatedUser()`](/sdk-ref/platform/modules/drs#setauthenticateduser) |
| `setUser()` | [`setAuthenticatedUser()`](/sdk-ref/platform/modules/drs#setauthenticateduser) |


See [Fraud Prevention SDK reference](/sdk-ref/platform/modules/drs) for details.

### Step 4: Update WebAuthn method signatures

WebAuthn methods have been refactored to use a single parameter object instead of multiple positional parameters:

**Before (v1):**


```js
webauthn.register('user@email.com', { displayName: 'Display Name' });
```

**After (v2.x):**


```js
webauthn.register({ username: 'user@email.com', options: { displayName: 'Display Name' } });
```

See [WebAuthn SDK reference](/sdk-ref/authnsdk/overview) for the updated method signatures.

### Step 5: Update Orchestration type imports

The Orchestration (IDO) module now uses separate typing files. If your TypeScript application imports IDO types, update the import paths:

**Before (v1):**


```typescript
import { IdoServiceResponse, ClientResponseOptionType } from '@transmitsecurity/platform-web-sdk';
```

**After (v2.x):**


```typescript
import type { IdoServiceResponse, ClientResponseOptionType } from '@transmitsecurity/platform-web-sdk/ido';
```

### Step 6: Update SDK version

Update the SDK package or CDN script to version 2:

Note
The `latest` will remain frozen on the last v1 release. To receive ongoing v2.x updates, explicitly install a v2.x version.

- **NPM**: Update to `@transmitsecurity/platform-web-sdk@^2`
- **CDN**: Change script URL from `1.x` to `2.x`


### Step 7: Test your integration

- Verify all SDK functionality works as expected
- Check browser console for any initialization errors