Skip to main content
What you will build

20 min | Intermediate

  • A Web SDK ambient encounter with problem-based charting enabled
  • One Assessment and Plan section marked as the Problem-Based Note (PBN)
  • EMR diagnoses seeded into the first session of the encounter
  • A note submit handler that reads sectioned note content
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 use-case tutorial, you build a React Web SDK ambient page for problem-based charting. You wrap with SukiProvider, authenticate with SukiAuthManager, call init, then mount SukiAssistant with ambientOptions: exactly one LOINC section with isPBNSection: true, EMR diagnoses for the first session, and onNoteSubmit to receive the note. By the end of this tutorial, documentation follows problems, merges visit discussion with diagnoses you already know, and your app receives sectioned note content on submit.

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.
  • Web SDK v2.1.2+ for the diagnoses block (EMR merge).
  • LOINC section codes from Note sections. This tutorial uses Assessment and Plan (51847-2) as the PBN.
If you are new to Web SDK ambient, complete Build a Web SDK ambient session first, then return here to add PBC.
Only one section can have isPBNSection: true. If more than one section is marked as PBN, the ambient session fails to start. Seed diagnoses only on the first session in an encounter. Later re-ambient cannot seed diagnoses.

Architecture

Project setup

  1. Use a React 18+ app that meets Web SDK prerequisites (see Prerequisites). Use Web SDK v2.1.2+ for diagnoses seeding.
  2. Install the required dependencies:
  1. Configure your credentials:
    • Keep partnerId and partnerToken ready for SukiAuthManager.
    • Confirm host URLs meet Web SDK prerequisites.
    • Have LOINC section codes ready. This tutorial uses Assessment and Plan (51847-2) as the PBN.

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.
2

Create SukiAuthManager and Call Init

Create one SukiAuthManager with useMemo, then call init from useSuki() when the SDK is not initialized yet.
3

Mark Assessment and Plan as the PBN

Build ambientOptions.sections with LOINC codes. Set isPBNSection: true on Assessment and Plan (51847-2) only. Use supported codes from Note sections.
4

Seed Existing Patient Diagnoses

Add diagnoses under ambientOptions for the first session in the encounter. Use ICD-10 only, exactly one code per diagnosis, and at least one of code or description. A seeded diagnosis appears in the note only if discussed during the visit. Refer to Existing patient diagnoses.
5

Mount SukiAssistant and Handle Note Submit

Pass encounter (patient identifier required; gender MALE | FEMALE | UNKNOWN), ambientOptions, and onNoteSubmit. Keep identifiers at most 36 characters. Note submit returns the same shape whether or not you seed diagnoses (noteId, encounterId, contents).

Full code example

React

Troubleshooting

Only one section may have isPBNSection: true.
Seed diagnoses only on the first session in an encounter.
Use LOINC 51847-2 for Assessment and Plan (not 51848-0).

Summary

In this tutorial, you:
  • Mounted Web SDK ambient with one PBN section.
  • Seeded EMR diagnoses on the first session in an encounter.
  • Handled note submit to receive sectioned note content.
Use problem-based charting for deeper guidance.

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
APIs

Build a Webhook Notification Receiver

Verify HMAC signatures, parse partner notifications, and handle success and failure events.

10 minBeginner
Last modified on July 23, 2026