Skip to main content
This example shows how to subscribe to Form filling SDK events with client.on(). You register listeners once when you create FormFillingClient, then use them for analytics, logging, or saving background results across every session on the page. Callbacks such as onSubmit run for one session at a time. Event listeners stay active until you unsubscribe. Refer to Events for when each event fires.
JavaScript
form-filling:submitted removes the iframe for a foreground session. form-filling:background-submitted does not: it means results arrived for a session that is no longer the foreground session (for example after replace or reopen), not merely that processing took longer than 60 seconds.

Next steps

Refer to Events for all event names and lifecycle Refer to Webhook handler for server-side saves Refer to EHR handoff to map structured_data to your EHR
Last modified on July 23, 2026