Skip to main content
This guide shows how to integrate Form filling capabilities into a browser-based JavaScript application with the Suki Web SDK. You will create the Auth Manager and Form filling Client, then start a Form filling session by calling await formFillingClient.start({ ... }) from your own code when the clinician is ready. Use this approach if you are building with vanilla JavaScript, or another non-React framework, and want to control when and where Form filling appears in your interface. Let’s get started!

Prerequisites

Before you begin, you must have the following requirements met:
  • Packages: Install @suki-sdk/js and @suki-sdk/core (Web SDK v3.2.0 or later).
  • Partner credentials: Obtain partnerId and partnerToken from Suki after Partner onboarding.
  • Template IDs: template_id UUIDs from your Suki support team for form_template_ids.
  • Encounter ID: Pass your encounter ID as correlation_id. Refer to Configuration for more details.
  • Browser and layout: Your app runs in a browser over HTTPS, with microphone access and a Form filling container that has height.
Refer to Prerequisites guide for more details.

Install the packages

Add both packages to the same project you load in the browser:
After you install, pull the SDK into your files with import, the same way as in the examples below. Use whatever approach your project already uses for other npm libraries. Import FormFillingClient from @suki-sdk/js. You do not need @suki-sdk/form-filling.

Step 1: Add container HTML

The hosted Form filling UI mounts inside the element you pass as rootElement. That node must have real height, or the iframe looks blank.
HTML
Refer to Configuration for recommended CSS.

Step 2: Create auth manager

Now you need to create the Auth Manager for your application. To create the Auth Manager, you must have the partnerId and partnerToken credentials from Suki. Refer to Partner onboarding guide to learn how to get these credentials. Once you have all the required credentials, create one auth manager for the page (or app shell). Code example for creating auth manager
JavaScript

Step 3: Create Form filling client

After you have created the auth manager, you can create the Form filling client for your application. The Form filling Client is the object that will be used to start the Form filling session. Create one Form filling client and reuse it for every start() call on that page. Code example for creating Form filling client
JavaScript

Step 4: Call start() to open Form filling

Now you can start the Form filling session by calling the start() method on the Form filling client. Call await formFillingClient.start({ ... }) from a click handler (or similar) when the DOM is ready. Pass rootElement, form_template_ids, onSubmit, and any optional fields you need. Refer to Configuration guide for more details on the available options and how to use them. Code example for starting Form filling
JavaScript
onSubmit is required. It runs when structured JSON is ready after processing, not when the clinician taps submit in the hosted UI.

Callbacks

You can pass onReady, onSubmit, and onCancel on start(), or listen with formFillingClient.on() for handlers that stay active across many sessions:
JavaScript
Refer to Callbacks for the FormFillingResult shape and Events for every event and payload.

Starting another session

Calling start() again replaces the active session. You do not need to call stop() manually just to open Form filling again:
JavaScript

Complete code example

Below is a complete code example in JavaScript for Form filling with a single container and button.
JavaScript
Your integration is working when the Form filling UI appears, the microphone is active, and onSubmit returns structured_data.

Best practices

  • Reuse one Form filling client. Build a single FormFillingClient for the page or shell and call it again for each session. Creating a new client on every click often resets the hosted UI and feels flaky.
  • Reuse one auth manager. Create SukiAuthManager once and pass that same instance into the client, the same pattern as in the steps above.
  • Handle when structured results arrive. You must supply onSubmit so the SDK can deliver structured_data. Map generated_values to your EHR or backend.
  • Pass correlation_id. Use your encounter ID so callbacks and Partner webhooks match the correct record.
  • Register a partner webhook for production saves on your server, not browser onSubmit alone.
  • Open Form filling only when the host is ready. The DOM node you use as rootElement should exist and have real height before you open. Otherwise the Form filling area can look blank.
  • Catch failures when opening Form filling. Wrap the start() call so auth or setup errors show up in your logs instead of disappearing.
  • Open again to start another session. A new start() call replaces the active session. You usually do not need a separate stop() step first.

Next steps

Refer to the following guides for more information. Follow Configuration to learn about the available options and how to use them. Follow React integration to learn how to integrate Form filling in a React application using the Suki Web SDK.
Last modified on July 23, 2026