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
When processing is complete,
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.client.start(). In React, pass the same fields as props on <FormFilling>.
Supported Form filling SDK callbacks
Pass these callbacks onclient.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.Form filling SDK events
Session callbacks run for onestart() 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
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 withuseFormFilling()
Refer to EHR handoff example for mapping generated_values to your chart
Refer to Configuration for all session options