Skip to main content
Callbacks let your app run your own code when Form filling reaches key moments in a session. You pass functions to the SDK; the SDK calls them when those moments happen. You do not poll for structured data. Registering callbacks In JavaScript, pass callbacks on the object you give to client.start(). In React, pass the same fields as props on FormFilling.
For every session field, refer to Configuration. For required vs optional setup, refer to the JavaScript or React integration guide.

Supported Form filling SDK callbacks

Pass these callbacks on client.start() in JavaScript, or as props on FormFilling in React.

SDK callbacks vs webhooks

After the clinician submits, Suki processes the session before structured JSON is ready. Your app can receive those results in two places: onSubmit and your webhook receive the same structured payload. The callback runs in the browser when processing completes. The webhook runs on your server.
Do not rely on onSubmit alone to save results. The clinician may close the tab before processing finishes and before your app persists the data.
Refer to Session workflow and the Webhook handler example.

Form filling SDK events

Session callbacks run for one start() call or one FormFilling mount. client.on() stays wired across many sessions, which is useful for logging, analytics, or a shared error handler. Subscribe once when you create the client:
JavaScript
Refer to Events for payload fields and Event handling example for a full listener setup.

FormFillingResult payload shape

FormFillingResult is the JSON object the SDK sends when a session finishes processing and structured form data is ready. It is not sent when the clinician taps submit; the SDK still processes the recording first. Your handler receives a FormFillingResult from onSubmit, onBackgroundSubmit, form-filling:submitted, or form-filling:background-submitted. Use it to match the session to your patient record and map filled forms into your EHR.
JSON
Each item in generated_values is a MedicalFormInstance: id, form_template_id, title, status, type, data, and optional correlation_id. Refer to FormFillingResult above for the full field list.

Next steps

Basic usage example - Session status UI with useFormFilling(). EHR handoff example - Mapping generated_values to your chart. Configuration - All session options.
Last modified on October 16, 2026