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.Plan dependency upgrades and auth refactors before rolling v3 to production. Start with What changed and How to migrate, then Before and after (v2 vs v3) for code examples.
Overview
In v2.x.x, you managed login by passing partner credentials, provider details, and related fields within a singleinitialize() (JavaScript) or init() (React) call.
In v3.0.0+, you must split these tasks. You still require a partner token, 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:- Generate a partner token: Obtain a partner token for the current user, following the same requirement as v2.
-
Create a SukiAuthManager instance: Create one
SukiAuthManagerinstance for your entire application. Pass in the token, the environment (staging or production), and the partner and provider details you previously used in v2. -
Initialize the SDK: Call
initialize()(JavaScript) orinit()(React) and include theauthManagerinstance along with your other Web SDK options. The Web SDK reads the authentication state directly from theauthManager.
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 and Migration to v2) for more details | Set environment on SukiAuthManager. Do not use isTestMode on the Web SDK init() call for environment selection in v3. |
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
environmentonSukiAuthManager, then passauthManagerintoinitialize()orinit(). -
Remove
isTestModefrom your init options when you migrate.
How to migrate
Follow the steps below to migrate to Web SDK v3.0.0+.Install and upgrade packages
Add
@suki-sdk/core. Upgrade @suki-sdk/js or @suki-sdk/react to v3. Refer to Install packages for more details.Create SukiAuthManager
Instantiate
SukiAuthManager with your partner token, provider fields, and environment (staging/production). This replaces using isTestMode on v2 init options for stage endpoints. Create once per session after the partner token is available.Pass authManager into the Web SDK
Replace inline auth arguments on
initialize() (JavaScript) or init() (React) with a single authManager instance.Step 1: Install packages
- Javascript
- React
Step 2: Implement authentication with SukiAuthManager
Create aSukiAuthManager instance, then pass authManager into the Web SDK.
Code example: create SukiAuthManager
- Javascript
- React
JavaScript
Create the manager once per session after your identity token is available for authentication.
Step 3: Initialize the Web SDK
- Initialize in JavaScript
- Initialize in React
In JavaScript, create the Before and after: JavaScript
SukiAuthManager instance once per stable set of credentials.JavaScript
The returned SDK client behavior remains aligned with v3 release notes for
@suki-sdk/js.Before and after: JavaScript initialize (v2 vs v3)
Migration checklist (v2 vs v3)
- Upgrade
@suki-sdk/jsor@suki-sdk/reactto v3 - Add dependency
@suki-sdk/core(required forSukiAuthManager) - Replace inline auth configuration with
new SukiAuthManager(...) - Pass
authManagerintoinitialize()in the JavaScript SDK orinit()in the React SDK - Remove
isTestModefrom init options; setenvironmentonSukiAuthManagerinstead of usingisTestModefor stage versus production behavior
Next steps
InitOptions
Learn about the options you can pass on init option types
AuthConfig (SukiAuthManager)
All fields you can pass into SukiAuthManager
Migration To v2
Start here if you are still on Web SDK v1.x.x
Web SDK Quickstart
Handle Web SDK errors after you migrate