Use this file to discover all available pages before exploring further.
This guide walks you through setting up the Suki Headless Web SDK in your React application, from installation to creating your first ambient recording session.What you will do
Install@suki-sdk/platform-react in your React project.
Wrap your app with PlatformClient and PlatformClientProvider at the root so all SDK hooks share one client.
Authenticate with useAuth inside that tree so users are signed in and tokens are available.
Create an ambient session with useAmbient, then control recording with useAmbientSession (start, pause, resume, submit, and optional context).
Wire up a minimal end-to-end flow using the complete example as a reference.
Using an AI coding tool?Copy the following prompt to add the Suki developer documentation as a skill and MCP server to your tool for better AI-assisted coding during the integration process.
Install the Suki developer docs as skill to get context on Suki’s developer tools, APIs, and SDKs.npx skills add https://developer.suki.aiThen add the Suki developer docs MCP server for access to documentation search. Follow the MCP instructions at https://developer.suki.ai/documentation/mcp.
Create a single PlatformClient instance and wrap your entire application with PlatformClientProvider. Hooks such as useAuth, useAmbient, and useAmbientSession must run under this provider.
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
import { useAuth } from '@suki-sdk/platform-react';function YourApp() { const { isLoggedIn, isPending, error, login } = useAuth({ partnerId: 'your-partner-id', // Required: Replace with your actual partner ID partnerToken: 'your-partner-token', // Required: Replace with your actual partner token autoRegister: true, // Optional: Automatically register users if they don't exist loginOnMount: true, // Optional: Sign in automatically when component mounts providerName: 'Dr. John Doe', // Required for auto-registration providerOrgId: 'org-123', // Required for auto-registration providerSpecialty: 'Cardiology' // Required for auto-registration }); if (isPending) { return <div>Signing in...</div>; } if (error) { return <div>Error: {error.message}</div>; } if (!isLoggedIn) { return <button onClick={login}>Sign In</button>; } return <div>Ready to use Suki Headless Web SDK</div>;}
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.
Once authenticated, create an ambient session using the useAmbient hook. This creates a session container that you’ll use for recording.
React
import { useEffect } from 'react';import { useAmbient } from '@suki-sdk/platform-react';function SessionCreator({ onSessionReady }) { const { ambientSessionId, session: { create, isPending, isSuccess, error } } = useAmbient(); // Create session when component mounts useEffect(() => { create(); }, [create]); // Pass session ID to parent when ready useEffect(() => { if (isSuccess && ambientSessionId) { onSessionReady(ambientSessionId); } }, [isSuccess, ambientSessionId, onSessionReady]); if (isPending) { return <div>Creating session...</div>; } if (error) { return <div>Error: {error.message}</div>; } return null;}
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.
Use the useAmbientSession hook to control recording. This hook provides methods to start, pause, resume, and submit recordings, along with session status.
Always use setSessionContext to provide relevant patient or encounter details. This context acts as a hint for the AI, resulting in significantly higher quality clinical notes.
Refer to the following guides to learn more:Platform client and provider - Understand how to use PlatformClient and PlatformClientProviderAuthentication hook - Learn more about authentication options and token managementCreate ambient session - Understand session creation in detailManage ambient session - Explore all recording controls and session contextError handling - Learn how to handle errors gracefullyOffline mode - Understand how the SDK handles network interruptions