Skip to main content
What you will build

20 min | Intermediate

  • 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
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. For all AI options (contextual menu, llms.txt, and skill.md), refer to AI-optimized documentation.

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.

Open in Cursor
In this tutorial, you build a custom ambient recorder UI with the Headless Web SDK. You wrap the app with 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:
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

  1. Use a React 18+ app that meets Headless Web SDK prerequisites.
  2. Install the required dependencies:
  1. Configure your credentials:
    • Keep staging partnerId and partnerToken ready for sign-in.
    • Confirm beta expectations with your Suki contact before production use.

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

React

Troubleshooting

Wrap the tree with PlatformClientProvider and pass client={client}.
Create only when signed in and you have not already created the session for this screen.
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 useAuth and created a session with useAmbient.
  • Controlled recording with useAmbientSession (start, pause, resume, and submit).

Other tutorials

Continue with another end-to-end tutorial.
Ambient

Build a Web SDK Ambient Session

Authenticate, initialize the Web SDK in React, and mount SukiAssistant for an ambient encounter.

15 minIntermediate
Ambient

Build an Ambient Streaming Client

Authenticate, create a session, stream PCM audio over WebSocket, and retrieve clinical note results.

20 minIntermediate
Last modified on July 23, 2026