Skip to main content
Quick summary
Callbacks let your app respond to events during a Form filling session, such as when the interface is ready, the clinician submits a form, or the session is canceled. Pass callbacks when you call start() to handle events for that session. If you want the same handler to run across multiple sessions, use event listeners with client.on() instead.

When processing is complete, onSubmit returns the structured form data. For production, also configure a partner webhook so your server receives the results even if the browser is closed before processing finishes.
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

Refer to Basic usage example for session status UI with useFormFilling() Refer to EHR handoff example for mapping generated_values to your chart Refer to Configuration for all session options
Last modified on July 23, 2026