Skip to main content
What you will build

15 min | Intermediate

  • One shared Dictation client for the chart screen.
  • A clinical notes field with a stable field id.
  • In-field Dictation that writes committed text back into that field.
Using an AI coding tool?Copy the prompt below to point your agent at the Dictation skill and Documentation MCP. For every task skill, refer to AI coding tools.

Fetch the Dictation skill and connect the documentation MCP.

Open in Cursor
In this tutorial, you add Dictation SDK in-field mode to a chart note textarea in React. You create one DictationClient, wrap the screen with DictationProvider, and mount <Dictation> only while that field is active. By the end of this tutorial, starting Dictation inserts text into your chart field through onSubmit.
The Dictation SDK is in beta. Confirm package versions and iframe requirements with your Suki contact before production use.

Prerequisites

Before you begin, make sure you have:
Reuse one client for the page. Creating a new DictationClient on every render tears the iframe down and makes the field feel unstable.

Architecture

Project setup

  1. Use a React 18+ browser app that meets Dictation SDK prerequisites (CSP and iframe hosts).
  2. Install the required dependencies:.
  1. Configure your credentials:.
    • Keep staging partnerId and partnerToken ready.
    • Reuse one DictationClient for the page. Creating a new client on every render tears the iframe down.

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 One Auth Manager and DictationClient

Build SukiAuthManager and DictationClient once inside useMemo. Do not create a new client per render or per field.Check: One DictationClient is created in useMemo and reused for the page.If it fails: Keep one DictationClient for the page. Creating a new client remounts the iframe and tears down the UI when the clinician types.
2

Wrap the Chart Screen with DictationProvider

Pass the shared client into DictationProvider. Every &lt;Dictation&gt; must be a child of that provider.Check: Every &lt;Dictation&gt; is a child of DictationProvider with the shared client.
3

Dictate into a Chart Field in In-Field Mode

Use a stable fieldId that matches your textarea id. Pass a wrapper with real height as rootElement. Mount &lt;Dictation&gt; only while that field should own the session. Update the field from onSubmit.Check: Starting Dictation commits text into the chart field through onSubmit, and fieldId matches the textarea id.If it fails: Confirm your host meets the Dictation SDK prerequisites, especially for iframe and CSP errors.

Full code example

React

Troubleshooting

Meet Dictation SDK prerequisites for allowed hosts.
Reuse one DictationClient for the page; recreating it remounts the iframe.
Confirm package versions with your Suki contact before production use.

Summary

In this tutorial, you:
  • Created one shared DictationClient for the chart screen.
  • Wrapped the screen with DictationProvider.
  • Mounted in-field Dictation so submitted text updates the notes field.

Other tutorials

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