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

Events - All event names and lifecycle. Webhook handler - Server-side saves. EHR handoff - Map structured_data to your EHR.
Last modified on October 16, 2026