Skip to main content
What you will build

15 min | Intermediate

  • A React page wrapped with the Web SDK provider.
  • One shared auth manager and a single SDK initialize call.
  • The hosted ambient UI for one patient encounter with LOINC note sections.
Using an AI coding tool?Copy the prompt below to point your agent at the Ambient skill and Documentation MCP. For every task skill, refer to AI coding tools.

Fetch the Ambient skill and connect the documentation MCP.

Open in Cursor
In this tutorial, you build a React ambient encounter page with the Web SDK. You install the packages, wrap the app with SukiProvider, authenticate with SukiAuthManager, call init, and mount SukiAssistant with patient encounter context. By the end of this tutorial, you will have a working React page that signs in to Suki and opens the hosted ambient UI for one encounter.

Prerequisites

Before you begin, make sure you have:
  • Completed Partner onboarding and received your partnerId and partnerToken.
  • A React 18+ app that can host the Web SDK UI.
  • Host URLs on the Suki allowlist and a partner JWT that meets Web SDK prerequisites.
Prefer staging credentials while you learn. Switch environment to production only when your partner configuration is ready.

Architecture

Project setup

  1. Use a React 18+ app that can host the Web SDK UI (see Prerequisites).
  2. Install the required dependencies. Refer to Web SDK installation.
  1. Configure your credentials:.
    • Keep partnerId and partnerToken ready for SukiAuthManager (prefer staging while you learn).
    • Confirm host URLs meet Web SDK prerequisites.

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

Wrap Your App with SukiProvider

In Web SDK v3, wrap your tree with SukiProvider. Run init in a child component, not on the provider.Check: The tree is wrapped with SukiProvider, and init runs in a child component.
2

Create SukiAuthManager and Call Init

Create SukiAuthManager once with useMemo, then call init with authManager from useSuki() when the SDK is not initialized yet.Check: init({ authManager }) runs once under SukiProvider when isInitialized is false.If it fails: Confirm init({ authManager }) runs once under SukiProvider when isInitialized is false.
3

Mount SukiAssistant with Encounter and Sections

Pass a valid encounter (patient identifier required; gender MALE | FEMALE | UNKNOWN) and ambientOptions.sections with LOINC codes. Keep identifiers at most 36 characters. Refer to Note sections.Check: SukiAssistant mounts with a patient identifier, gender MALE | FEMALE | UNKNOWN, LOINC sections, and identifiers at most 36 characters.If it fails: Patient identifier is required, and gender must be MALE, FEMALE, or UNKNOWN. Keep identifiers at most 36 characters. Check partnerId, partnerToken, and allowlisted hosts in Web SDK prerequisites.

Full code example

React

Troubleshooting

Confirm init({ authManager }) runs once under SukiProvider when isInitialized is false.
Check partnerId / partnerToken and allowlisted hosts in Web SDK prerequisites.
Patient identifier is required; gender must be MALE, FEMALE, or UNKNOWN; keep identifiers at most 36 characters.

Summary

In this tutorial, you:
  • Wrapped the app with SukiProvider.
  • Authenticated with SukiAuthManager and called init.
  • Mounted SukiAssistant with encounter context and LOINC sections.
Prefer staging credentials until your partner configuration is production-ready.

Other tutorials

Continue with another end-to-end tutorial.
Last modified on October 16, 2026