What you will build
- A shared platform client for your React app
- Sign-in with Headless auth
- An ambient session for recording
- Start, pause, resume, and submit controls, plus session context after start
Install the Suki developer docs as a skill to get context on Suki's developer tools, APIs, and SDKs. Add the MCP server for documentation search.
PlatformClientProvider, sign in with useAuth, create a session with useAmbient, and control recording with useAmbientSession.
By the end of this tutorial, you will have a React page that authenticates, creates an ambient session, and exposes start, pause, resume, and submit controls.
The Headless Web SDK is in beta. APIs and docs may change. Confirm package versions with your Suki contact before production use.
Prerequisites
Before you begin, make sure you have:- Completed Partner onboarding.
- A React 18+ app that meets Headless Web SDK prerequisites.
- Staging
partnerIdandpartnerTokenvalues.
Headless Web SDK is for custom UIs. If you want the hosted ambient chrome, use the Web SDK ambient session tutorial instead.
Architecture
Project setup
- Use a React 18+ app that meets Headless Web SDK prerequisites.
- Install the required dependencies:
-
Configure your credentials:
- Keep staging
partnerIdandpartnerTokenready for sign-in. - Confirm beta expectations with your Suki contact before production use.
- Keep staging
Tutorial steps
Work through each step in order. Read the explanation, review the code example, then continue to the next step. The full code example is available in the accordion below.1
Create PlatformClient and Wrap the App
Create one
PlatformClient and wrap your app with PlatformClientProvider so hooks share the same client.2
Authenticate with UseAuth
Call
useAuth under the provider. When autoRegister is true, pass providerName, providerOrgId, and providerSpecialty.3
Create an Ambient Session with UseAmbient
Use
useAmbient to create a session. Wait for isSuccess before you pass ambientSessionId into recording hooks.4
Start, Pause, Resume, and Submit with UseAmbientSession
Pass the session ID into
useAmbientSession. After start(), call setSessionContext with patient and visit details to improve note quality. Track recording versus paused in local state. sessionStatus is only created, submitted, completed, or cancelled.Full code example
Troubleshooting
Hooks Fail Outside Provider
Hooks Fail Outside Provider
Wrap the tree with
PlatformClientProvider and pass client={client}.Session Create Never Runs
Session Create Never Runs
Create only when signed in and you have not already created the session for this screen.
Beta API Surprises
Beta API Surprises
Treat this surface as beta; confirm package versions with your Suki contact.
Summary
In this tutorial, you:- Wrapped the app with
PlatformClientProvider. - Signed in with
useAuthand created a session withuseAmbient. - Controlled recording with
useAmbientSession(start, pause, resume, and submit).