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
- Via API (server-side)
- Via SDK (client-side)
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.Template schema
A template schema is an object with afields array. Each field defines one piece of data Squire should extract from the consultation.
Field properties
Field types
Schema example
Processing results
When thesummary-ready event fires, use the Template utility class to extract field values from the response without manually traversing the data structure.