- Install
@suki-sdk/platform-reactin your React project. - Wrap your app with
PlatformClientandPlatformClientProviderat the root so all SDK hooks share one client. - Authenticate with
useAuthinside that tree so users are signed in and tokens are available. - Create an ambient session with
useAmbient, then control recording withuseAmbientSession(start, pause, resume, submit, and optional context). - Wire up a minimal end-to-end flow using the complete example as a reference.
Prerequisites
For the rest of this documentation, we assume the following setup is complete:- You have received your
partnerIdfrom Suki. - Your host URLs are on the Suki allowlist.
- Your partner configuration in the Suki Platform points to your correct JWKS endpoint.
- Your JWT token contains the key that you specified as your User identifier field.
Install the package
To begin, install the Suki Headless Web SDK package in your React project:Required configuration
Create a singlePlatformClient instance and wrap your entire application with PlatformClientProvider. Hooks such as useAuth, useAmbient, and useAmbientSession must run under this provider.
React
Authenticate with useAuth
After the provider wraps your app, useuseAuth in a child component (for example YourApp). This hook manages user identity and provides access tokens needed for all SDK operations.
React
If you set
autoRegister: true, you must provide providerName, providerOrgId, and providerSpecialty. If you prefer manual registration, set autoRegister: false and use the registerUser method. See the Authentication hook guide for more details.Create ambient session
Once authenticated, create an ambient session using theuseAmbient hook. This creates a session container that you’ll use for recording.
React
You must wait for
isSuccess to be true before attempting to use the ambientSessionId. Passing an undefined ID to the recording hooks will cause errors.Manage recording
Use theuseAmbientSession hook to control recording. This hook provides methods to start, pause, resume, and submit recordings, along with session status.
React
Complete example
Here’s a complete example that brings everything together:React
Next steps
Refer to the following guides to learn more: Platform client and provider - Understand how to usePlatformClient and PlatformClientProvider
Authentication hook - Learn more about authentication options and token management
Create ambient session - Understand session creation in detail
Manage ambient session - Explore all recording controls and session context
Error handling - Learn how to handle errors gracefully
Offline mode - Understand how the SDK handles network interruptions