- 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 run a React 18+ app with a standard bundler (Vite, Webpack, or Next.js).
- 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.
- You can request microphone access over HTTPS in production (and set iframe
allowattributes if your app is embedded).
Create your first Headless Web SDK Ambient session
1
Install the Package
Install the Suki Headless Web SDK package in your React project.For detailed setup instructions, refer to the Installation guide.
2
Configure the Platform Client
Create a single
PlatformClient instance and wrap your entire application with PlatformClientProvider. Hooks such as useAuth, useAmbient, and useAmbientSession must run under this provider.React
3
Authenticate with useAuth
After the provider wraps your app, use
useAuth 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.4
Create an Ambient Session
Once authenticated, create an ambient session using the
useAmbient 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.5
Manage Recording
Use the
useAmbientSession hook to control recording. This hook provides methods to start, pause, resume, and submit recordings, along with session status.React
6
Complete Example
Here’s a complete example that brings everything together:
React
Available tutorials
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