Skip to main content
The code snippets below show JavaScript and React integrations to configure the SukiAuthManager and DictationClient. Replace placeholder values with your partner credentials and DOM nodes.
JavaScript
import { SukiAuthManager } from "@suki-sdk/core";
import { DictationClient } from "@suki-sdk/dictation";

const authManager = new SukiAuthManager({
  partnerId: "YOUR_PARTNER_ID", // Required
  partnerToken: "YOUR_PARTNER_TOKEN", // Required
  environment: "staging", // Optional
  loginOnInitialize: true, // Optional
  providerName: "John doe", // Optional
  providerOrgId: "1234", // Optional
  providerId: "1234567890", // Optional
  providerSpecialty: "FAMILY_MEDICINE", // Optional
});

const dictationClient = new DictationClient({ authManager }); 

await dictationClient.show({
  mode: "in-field",
  fieldId: "clinical-notes",
  rootElement: document.getElementById("clinical-notes-field-root-element-id"),
  initialText: "",
  onSubmit: ({ fieldId, text }) => {
    const el = document.getElementById(fieldId);
    if (el) el.value = text;
  },
  onCancel: ({ fieldId }) => {
    console.log("Cancelled", fieldId);
  },
  onDraft: ({ fieldId, text }) => {
    // Optional: e.g. user left without submit; persist draft in your app if needed
    console.log("Draft", fieldId, text);
  },
});
In a real React app, obtain rootElement with useRef and a useEffect (or render the wrapper in the same tree) so you do not call document.getElementById during SSR. See React integration for patterns that match your app.

Next steps

Last modified on April 20, 2026