- Install the Dictation SDK package for your framework (JavaScript or React)
- Create a
SukiAuthManagerfrom@suki-sdk/corewith yourpartnerTokenand provider fields - Create a
DictationClientfrom@suki-sdk/dictationwith your auth manager - Mount the Dictation UI into your application using the
encounterobject.
Prerequisites
Before you start, ensure you have the following:- You have received your
partnerIdandpartnerTokenfrom Suki. - Your app meets browser, CSP, and host requirements for the dictation iframe
Recommended integration pattern
The Dictation SDK works best when you treat authentication and the dictation client as long-lived objects for a page or session. You should only change the specific field or surface receiving the dictation. This approach ensures that token refreshes and iframe setups remain predictable while avoiding duplicate overlays. A common mistake is to build a newDictationClient on every React render (for example, in the component body without useMemo) or to use a separate client for each text field. The SDK assumes one client per page scope. If you do not follow this pattern, the session and iframe will frequently tear down and restart. This creates an unstable experience for the user.
Suki Auth Manager
Create
SukiAuthManager from @suki-sdk/core after the partner token is available.Dictation Client
Create
DictationClient with that authManager. Reuse this client across dictation fields.Dictation Provider (React only)
In React, wrap components with
DictationProvider from @suki-sdk/dictation-react.Dictation Per Active Field
Show the dictation UI per field or scratchpad. Avoid recreating
DictationClient on every render or per field.Field IDs
Each dictation instance needs a stable, uniquefieldId. The SDK sends it back on every callback with text, so you can route results to the right control.
A common pattern is to match the target input’s HTML id. Refer to Field IDs section in Configuration guide for more details.
Install the packages
- JavaScript
- React
Create your first dictation session
Apply Recommended integration pattern above: buildSukiAuthManager and DictationClient once, then open dictation only for the target that should be active.
For JavaScript, give dictation a container (rootElement) with real height. Example markup:
- JavaScript
- React
Create the auth manager and client once, then call Your integration is working when the dictation UI appears inside
show() when the user should dictate (for example after a button click). Use try / catch so configuration or auth errors surface in your logs.JavaScript
dictation-root, you can dictate, and text you commit is written to the textarea in onSubmit.