- Set up sign-in once per page.
- Pass session options each time the clinician opens Form filling in your app.
client.start(). In React, pass the same fields as props on FormFilling. Sign-in must succeed before the hosted UI opens in your app.
1
Authenticate with Suki for Partners
Create
SukiAuthManager from @suki-sdk/core with your partnerId, partnerToken, and environment (staging or production). Optionally pass provider fields such as providerId and providerName. Set autoRegister: false unless you use provider auto-registration (autoRegister defaults to true).Pass that manager to new FormFillingClient({ authManager }). Create both once per page and reuse them for every session.Refer to Authentication for sign-in setup and required fields.2
Define Session Options
Each time the clinician opens Form filling, pass session options to
client.start() or render FormFilling with the same fields.Requiredformsorform_template_ids: At least one form after resolve. Preferforms.form_template_idsis deprecated, but still works whenformsis omitted. Refer to Dynamic and static medical forms below.onSubmit: Handler that receives structured JSON after processing completes, not when the clinician taps submit.rootElement: Container for the hosted UI. JavaScript only. React supplies the container automatically.
correlation_id: Your encounter or appointment ID. Strongly recommended. See Encounter ID (correlation_id) below.onReady: Runs when the hosted UI loaded and is ready for the clinician.onCancel: Runs when the clinician cancels without submitting.onBackgroundSubmit(React): Runs forform-filling:background-submittedwhen results arrive for a superseded session while the iframe is still open.
Dynamic and static medical forms
When you open Form filling withclient.start() or FormFilling, pass the medical forms the clinician will fill in that Form filling run. Prefer the forms array. Each entry is MedicalFormMetadata: exactly one of form_template_id (a Suki Medical form template) or schema (a partner-defined form). You can mix both in one forms array.
You can also pass Suki template IDs with form_template_ids when you omit forms. That option is deprecated and will be removed in a future major release. For new integrations, pass forms: [{ form_template_id }]. If you pass forms, the SDK uses that list only and ignores form_template_ids.
Rules for each
forms entry:
- Include exactly one of
form_template_idorschema. Do not send both, and do not send neither. schemamust be a non-empty plain object. An empty object ({}) is invalid and yieldsSUKI_FF_001withinvalid-form-entry.- Keep every
form_template_idunique among static entries, and every dynamicidunique among dynamic entries. - If you omit dynamic
id, the SDK generates a UUID so you can still correlate results. - One form starts recording immediately. More than one form shows the hosted selection UI (catalogue titles for static forms,
nameor a generated title for dynamic forms).
forms when you open Form filling. Use a Suki template, a partner schema, or both in the same array:
JavaScript
form_template_ids is an older way to pass only Suki template IDs as strings, for example ["YOUR_TEMPLATE_ID"]. The SDK maps each string to { form_template_id }. It cannot carry partner schema entries. This option is deprecated. Prefer forms. If you also pass forms, the SDK ignores form_template_ids.
For partner schema shapes and XOR examples, refer to Dynamic Form filling.
Encounter ID (correlation_id)
In the SDK, your encounter or appointment identifier iscorrelation_id. Pass it when you start a session so structured results map to the correct patient record in your app and on your server.
If you omit
correlation_id, the hosted UI creates its own ID for the session. That ID will not match your encounter unless you map sessions another way.FormFillingClient constructor
These are the settings you pass when you create the client once per page in JavaScript.client.start(options)
These are the settings you pass each time you open Form filling in JavaScript.React: FormFilling props
In React, pass the same session options asclient.start() as props on FormFilling. You do not pass rootElement. The component renders the hosted UI in .suki-form-filling for you.
Container sizing
The hosted Form filling UI fills its container. Without explicit height, the iframe looks blank. In JavaScript, set height on#suki-form-container (or your rootElement) before start(). In React, set height on .suki-form-filling.
CSS