SukiAuthManager class from @suki-sdk/core to authenticate users. Create one auth manager after your application receives the user’s Partner Token, then pass it to initialize() in JavaScript or init() in React.
Web SDK v3 changes how you configure authentication. If you are upgrading from Web SDK v2, follow the Web SDK v3 migration guide to update your integration.
Prerequisites
Before you configure authentication, ensure that:- You have completed Partner onboarding and received your Partner ID.
- Your identity provider issues a signed Partner Token (JWT) after the user signs in.
- Suki has your public keys or JWKS endpoint and knows which JWT claim identifies the user.
- You have installed
@suki-sdk/corewith either@suki-sdk/jsor@suki-sdk/react.
How Web SDK authentication works
1
User Sign-In
The user signs in through your application. Your identity provider issues a Partner Token for that user.
2
Create SukiAuthManager
Your application creates
SukiAuthManager with the Partner ID, Partner Token, environment, and provider details.3
Initialize the Web SDK
The Web SDK uses the
SukiAuthManager instance to authenticate the user during initialization and exchanges the Partner Token for access to Suki services.Create one
SukiAuthManager instance for each stable set of user credentials. Do not create a new instance on every React render.Configure SukiAuthManager
Pass your authentication and provider values toSukiAuthManager:
JavaScript
The examples set
loginOnInitialize: true so SukiAuthManager authenticates when you create the instance. If you use the default value of false, call await authManager.login() after creating the instance and before passing it to initialize() or init().Authenticate with JavaScript
Create the auth manager after the Partner Token is available, then pass it toinitialize():
JavaScript
sdkClient for Web SDK operations. Do not call initialize() again for the same user session.
Authenticate with React
Wrap your application withSukiProvider. In a child component, create the auth manager with useMemo(), then pass it to init() from useSuki().
SukiProvider component tree. Memoize it so React re-renders do not create duplicate instances.
Update an expiring Partner Token
The Web SDK refreshes its Suki access token while the current Partner Token remains valid. When your identity provider rotates the Partner Token, update the existing SDK session instead of creating another auth manager.Next steps
Follow the Web SDK quickstart to mount the SDK UI after authentication. Review Migrating to Web SDK v3 if your integration still passes partner fields directly toinitialize() or init().