Skip to main content
Templates control the shape of the data Squire returns after each consultation. By defining a template, you tell Squire which fields to extract and how to structure the output — so you can map it directly to your EHR’s data model without additional transformation.
Passing templateSchema directly in startRecording is new in SDK v1.6.0. If you are on an earlier version, use the API approach described below.

Two ways to use templates

You can provide a template to Squire either server-side via the API or client-side via the SDK.
1

Choose your approach

Use the API approach if you manage templates centrally on your server and want to reuse them across multiple clients. Use the SDK approach if you need to define or update templates dynamically at the point of recording.
2

Create or pass the template

Create and store the template by posting to the Template API on your server. Once created, pass the returned template ID when starting a recording:
3

Receive structured output

Listen for the summary-ready event and process the returned data using the Template utility class. See Processing results below.
Always provide a templateId string when passing templateSchema. This can be any string — for example, your own internal ID. The ID appears in the Squire Portal, which makes templates easier to identify and debug.

Template schema

A template schema is an object with a fields array. Each field defines one piece of data Squire should extract from the consultation.

Field properties

Field types

Schema example

Processing results

When the summary-ready event fires, use the Template utility class to extract field values from the response without manually traversing the data structure.

Template utility methods