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

# Migrating To Web SDK v3

> Migrate Web SDK v2 integrations to v3 with SukiAuthManager from @suki-sdk/core and updated init patterns

Quick summary

**Breaking change:** From Web SDK `v3.0.0+`, the Web SDK authentication is shared with the other Suki SDKs using a `SukiAuthManager` from `@suki-sdk/core`. You cannot rely on passing `partnerId`, `partnerToken`, and related fields only through `initialize()` or `init()` without constructing `SukiAuthManager` first.

> [!CAUTION]
>
> Plan dependency upgrades and auth refactors before rolling v3 to production. Start with [What changed](#what-changed) and [How to migrate](#how-to-migrate), then [Before and after (v2 vs v3)](#before-and-after-v2-vs-v3) for code examples.

Last updated:
November 2026

In v2.x.x, you managed login by passing partner credentials, provider details, and related fields within a single `initialize()` (JavaScript) or `init()` (React) call.
In v3.0.0+, you must split these tasks. You still require a **`partnerToken`**, but you no longer provide all fields during the initialization call. Instead, you create an instance of the `SukiAuthManager` class from the `@suki-sdk/core` package.

The Suki Web SDK now requires this instance to manage authentication state.

### Implementation steps

Follow these steps to configure authentication:

1. **Generate a `partnerToken`**: Obtain a `partnerToken` for the current user, following the same requirement as v2.

2. **Create a SukiAuthManager instance**: Create one `SukiAuthManager` instance for your entire application. Pass in the token, the **environment** (staging or production), and the **partner** and **provider** details you previously used in v2.

3. **Initialize the SDK**: Call `initialize()` (JavaScript) or `init()` (React) and include the `authManager` instance along with your other Web SDK options. The Web SDK reads the authentication state directly from the `authManager`.

## What changed

| Topic | v2 | v3 |
| :- | :- | :- |
| Where auth config lives | Partner fields passed directly into `initialize()` / `init()` | You build `new SukiAuthManager({ ... })` and pass `{ authManager }` into `initialize()` or `init()` |
| New dependency | Not required | `@suki-sdk/core` (provides `SukiAuthManager`) |
| Stage vs production / test mode | Optional `isTestMode` on `initialize()` / `init()` options (Refer to [InitOptions](https://developer.suki.ai/web-sdk/api-reference/types/init-options.md) and [Migration to v2](https://developer.suki.ai/web-sdk/product-updates/migration-to-v2.md)) for more details | Set `environment` on `SukiAuthManager`. Do not use `isTestMode` on the Web SDK `init()` call for environment selection in v3. |

> [!NOTE]
>
> In Web SDK v2, setting **`isTestMode`** to true would route the SDK to stage endpoints. In v3, **`isTestMode` is deprecated** for environment selection.
>
> * Configure **staging versus production** through **`environment`** on **`SukiAuthManager`**, then pass **`authManager`** into **`initialize()`** or **`init()`**.
>
> * Remove **`isTestMode`** from your init options when you migrate.

## How to migrate

Follow the steps below to migrate to Web SDK v3.0.0+.

**1. Install and Upgrade Packages**

Add **`@suki-sdk/core`**. Upgrade **`@suki-sdk/js`** or **`@suki-sdk/react`** to v3. Refer to [Install packages](#step-1-install-packages) for more details.

**2. Create SukiAuthManager**

Instantiate **`SukiAuthManager`** with your `partnerToken`, provider fields, and **`environment`** (staging/production). This replaces using **`isTestMode`** on v2 init options for stage endpoints. Create **once per session** after the `partnerToken` is available.

**3. Pass AuthManager into the Web SDK**

Replace inline auth arguments on `initialize()` (JavaScript) or `init()` (React) with a single `authManager` instance.

**4. Validate in Staging**

Run your usual flows (login, mount, sessions) in a non-production environment before promoting to production.

## Step 1: Install packages

> [tab] JavaScript
>
> ```shell pnpm theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> pnpm add @suki-sdk/js@latest @suki-sdk/core
> ```
>
> ```shell npm theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> npm install @suki-sdk/js@latest @suki-sdk/core
> ```
>
> ```shell yarn theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> yarn add @suki-sdk/js@latest @suki-sdk/core
> ```

> [tab] React
>
> ```shell pnpm theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> pnpm add @suki-sdk/react@latest @suki-sdk/core
> ```
>
> ```shell npm theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> npm install @suki-sdk/react@latest @suki-sdk/core
> ```
>
> ```shell yarn theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> yarn add @suki-sdk/react@latest @suki-sdk/core
> ```

## Step 2: Implement authentication with SukiAuthManager

Create a `SukiAuthManager` instance, then pass `authManager` into the Web SDK.

### Code example: create SukiAuthManager

> [tab] JavaScript
>
> ```javascript JavaScript theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> import { SukiAuthManager } from "@suki-sdk/core";
>
> const authManager = new SukiAuthManager({
>   partnerId,
>   partnerToken,
>   environment: "production",
>   autoRegister: false,
>   loginOnInitialize: true,
>   providerId,
>   providerName,
>   providerOrgId,
>   providerSpecialty,
> });
> ```

> [tab] React
>
> In React, create the manager **inside a component** with `useMemo` so you do not instantiate it on every render or at module scope. Adjust the dependency array when `partnerId`, `partnerToken`, or other constructor
> inputs change.
>
> ```tsx React theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> import { useMemo } from "react";
> import { SukiAuthManager } from "@suki-sdk/core";
>
> function YourBootstrap() {
>   const authManager = useMemo(
>     () =>
>       new SukiAuthManager({
>         partnerId,
>         partnerToken,
>         environment: "production",
>         autoRegister: false,
>         loginOnInitialize: true,
>         providerId,
>         providerName,
>         providerOrgId,
>         providerSpecialty,
>       }),
>     [partnerId, partnerToken],
>   );
>
>   return <>{/* your app content */}</>;
> }
> ```

> [!NOTE]
>
> Create the manager **once per session** after your identity token is available for authentication.

## Step 3: Initialize the Web SDK

> [tab] JavaScript
>
> In JavaScript, create the `SukiAuthManager` instance once per stable set of credentials.
>
> ```javascript JavaScript highlight={2,12-17} theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> import { SukiAuthManager } from "@suki-sdk/core";
> import { initialize } from "@suki-sdk/js";
>
>
> const authManager = new SukiAuthManager({
>   partnerId,
>   partnerToken,
>   environment: "production",
>   autoRegister: false,
>   loginOnInitialize: true,
>   providerId,
>   providerName,
>   providerOrgId,
>   providerSpecialty,
> });
>
> initialize({
>   authManager, // new in v3
>   enableDebug: false,
>   theme,
> });
> ```
>
> > [!NOTE]
> >
> > The returned SDK client behavior remains aligned with v3 release notes for `@suki-sdk/js`.
>
> ### Before and after: JavaScript `initialize` (v2 vs v3)
>
> ```javascript JavaScript - SDK (v2) theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> import { initialize } from "@suki-sdk/js";
>
> initialize({
>   partnerId,
>   partnerToken,
>   enableDebug: true,
>   isTestMode: true,
>   theme
> });
> ```
>
> ```javascript JavaScript - SDK (v3) theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> import { SukiAuthManager } from "@suki-sdk/core";
> import { initialize } from "@suki-sdk/js";
>
> const authManager = new SukiAuthManager({
>   partnerId,
>   partnerToken,
>   environment: "staging",
> });
>
> initialize({
>   authManager,
>   enableDebug: true,
>   theme
> });
> ```

> [tab] React
>
> In a component under `SukiProvider`, use the `SukiAuthManager` from Step 2 with `useSuki()`. In a `useEffect`, call `init({ authManager, ... })` only when `!isInitialized` so you do not initialize twice. See the [Quickstart](https://developer.suki.ai/web-sdk/quickstart.md) for a full example.
>
> ```tsx React highlight={1,3,17-28} theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> import { useEffect, useMemo } from "react";
> import { SukiAuthManager } from "@suki-sdk/core";
> import { useSuki } from "@suki-sdk/react";
>
> function YourAppContent() {
>   const authManager = useMemo(
>     () =>
>       new SukiAuthManager({
>         partnerId,
>         partnerToken,
>         environment: "production",
>         autoRegister: false,
>         loginOnInitialize: true,
>       }),
>     [partnerId, partnerToken],
>   );
>
>   const { init, isInitialized } = useSuki();
>
>   useEffect(() => {
>     if (!isInitialized) {
>       init({
>         authManager,
>         uiOptions,
>         ambientOptions,
>       });
>     }
>   }, [authManager, init, isInitialized]);
>
>   return (
>     <div>
>       {/* your app content */}
>     </div>
>   );
> }
> ```
>
> Create the manager once per stable set of credentials (see `useMemo` dependencies). Apply this inside your provider tree, not at module scope.
>
> ### Before and after: React `init` (v2 vs v3)
>
> ```tsx React - SDK (v2) theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> import { useEffect } from "react";
> import { useSuki } from "@suki-sdk/react";
>
> const initOptions = {
>   partnerId,
>   partnerToken,
>   providerName,
>   providerOrgId,
>   isTestMode,
>   enableDebug,
>   theme,
> };
>
> function App() {
>   const { init } = useSuki();
>
>   useEffect(() => {
>     init(initOptions);
>   }, [init]);
>
>   return (
>     <div>
>       {/* your app content */}
>     </div>
>   );
> }
> ```
>
> ```tsx React - SDK (v3) theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> import { useEffect, useMemo } from "react";
> import { SukiAuthManager } from "@suki-sdk/core";
> import { useSuki } from "@suki-sdk/react";
>
> function App() {
>   const authManager = useMemo(
>     () =>
>       new SukiAuthManager({
>         partnerId,
>         partnerToken,
>         environment: "production",
>         autoRegister: false,
>         loginOnInitialize: true,
>         providerId,
>         providerName,
>         providerOrgId,
>         providerSpecialty,
>       }),
>     [
>       partnerId,
>       partnerToken,
>       autoRegister,
>       loginOnInitialize,
>       providerId,
>       providerName,
>       providerOrgId,
>       providerSpecialty,
>     ],
>   );
>
>   const { init, isInitialized } = useSuki();
>
>   useEffect(() => {
>     if (!isInitialized) {
>       init({
>         authManager,
>         enableDebug,
>         theme,
>       });
>     }
>   }, [authManager, init, isInitialized]);
>
>   return (
>     <div>
>       {/* your app content */}
>     </div>
>   );
> }
> ```

## Migration checklist (v2 vs v3)

* Upgrade `@suki-sdk/js` or `@suki-sdk/react` to v3.
* Add dependency `@suki-sdk/core` (required for `SukiAuthManager`).
* Replace inline auth configuration with `new SukiAuthManager(...)`.
* Pass `authManager` into `initialize()` in the JavaScript SDK or `init()` in the React SDK.
* Remove **`isTestMode`** from init options; set **`environment`** on **`SukiAuthManager`** instead of using **`isTestMode`** for stage versus production behavior.

## Next steps

&#x20;**[InitOptions](https://developer.suki.ai/web-sdk/api-reference/types/init-options.md)** - Learn about the options you can pass on init option types.

&#x20;**[AuthConfig (SukiAuthManager)](https://developer.suki.ai/dictation-sdk/guides/configuration.md#authconfig)** - All fields you can pass into SukiAuthManager.

&#x20;**[Migration to v2](https://developer.suki.ai/web-sdk/product-updates/migration-to-v2.md)** - Start here if you are still on Web SDK v1.x.x.

&#x20;**[Web SDK quickstart](https://developer.suki.ai/web-sdk/quickstart.md)** - Handle Web SDK errors after you migrate.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.