Skip to main content
window.TelepatiaEmbedConfig (read at load) and TelepatiaEmbed.init() take the same shape; init() wins when both set a field. Everything is optional except the publishable key and, with Scribe, the consultation ID.

Fast configuration

The minimal block to go live: the key, a locale, your brand, and the capabilities you want. Each capability renders only when your institution is also granted it.

Full configuration

Every field, annotated. All are optional except apiKey: without it, init() throws an error and mounts nothing. With Scribe, consultation.externalConsultationId is required too: without it, init() does not throw, and the panel shows an error screen. The defaults shown are what the embed uses when you omit a field.

Config fields

Capabilities

Each capability is a { show } flag. What actually mounts is show AND the institution’s grant, so an ungranted flag renders nothing. Without scribeContext, the embed mounts a recorder-less surface (CDSS and/or Telepatia Intelligence) with no audio engine in its graph. intelligence.documents adds a Documents sub-tab inside the copilot. A session id in cdss.scribeSessionId or intelligence.chat.recentConsultations[].id is the ss_… id that the public API and the webhooks return. A session UUID also works.

The consultation ID

With Scribe, consultation.externalConsultationId is required. It is your id for the consultation, and you use it to get the result. Each id holds one recording, so send a new id for each consultation. The embed checks the id when the panel opens. If the id is missing, has a dot (.), or another recording already uses it, the panel shows only a screen with “There is a problem with this consultation’s ID.” and “Contact your organization’s IT support.” The doctor cannot start a recording, and the other tabs do not show. init() does not throw for a missing id: the screen shows instead. The browser console gets one line that starts with [Telepatia Embed]. The same screen shows when the doctor opens again a consultation that already has a recording. To record it again, open the embed with a new id.
Do not use a fixed id, also in your tests. The second recording with the same id shows the screen.

Sync your EMR fields

Point the embed at the notes and clinical history fields of your EMR page. The embed keeps them equal to its own Notes and Patient clinical history, in both directions: what the doctor types on your page appears in the embed, and what the doctor types in the embed appears on your page. You write no DOM code.
The embed sees what a person types in your field. If your own code sets the field’s value without an input event, the embed reads that value only when it starts and at each new consultation. For a field inside a closed shadow root, pass the element, not a selector. bind needs scribeContext: { show: true }.

Send the patient’s clinical history

The Patient clinical history card shows the doctor what you already know about the patient, and Telepatia reads it when it writes the note. To fill it, pass the history in init().
When the doctor starts the consultation, the card shows your history. For each consultation, call destroy() then init() with that patient’s history. The embed keeps the history only for that init(): it does not save it in the browser, and the next consultation never shows it.

Or send it from your backend

If your backend already holds the history, it can send it instead:
  1. From your backend, call set consultation context with the doctor’s secret key (sk_…, the pair of the pk_… on your page). Put the history in pastMedicalHistory.
  2. Open the embed for the same consultation and the same patient: consultation.externalConsultationId is the consultationInternalId you sent, and patient.idCountry · idType · idValue is the identity you sent.
  3. When the doctor starts the consultation, the card shows your history.
If you send a history both ways, the one in init() wins. An empty pastMedicalHistory in init() keeps the one your backend sent.
Send the context once per consultation, before the doctor opens the embed. If you send scribeSessionModality, the consultation takes it. The template is always the one from init() or the doctor’s choice, never one sent with the context.

Match your site

settings.theme takes a palette. The embed paints with a brand scale and a neutral scale. Give one colour for each (the embed mixes the other shades from it) or the shades you already use. The palette replaces the CSS you inject into the shadow root: remove that CSS.
With a palette, the send button’s icon takes black or white, whichever reads on your brand. Without a palette, it keeps the default colours. With intelligence.fillPhone, below 640 px the panel fills the screen in every layout, inline too. The composer stays above the keyboard. The panel stays clear of the notch and the home indicator when your page sets viewport-fit=cover. Without it, nothing changes on a phone.

TelepatiaEmbed methods

After the panel mounts, a new init() applies only open, callbacks and intelligence.onAnswer · onCitationOpen; other fields take effect after destroy() then init(). Without Scribe, init() returns a handle:

Callbacks and errors

Register them in init({ callbacks }): onSessionStart(id), onSessionComplete(event), onError(message), onStateChange(state). The browser onSessionComplete is optional — the webhook is the reliable trigger. For a consultation ID problem, onError gets "externalConsultationIdMissing", "externalConsultationIdInvalid" or "externalConsultationIdAlreadyUsed" (see The consultation ID). Health signals fire on window:
Backend fetch errors use Telepatia’s standard format — switch on code: authentication_required (401, key invalid or expired), resource_not_found (404, wrong id or fetched too early), resource_conflict (409, id reused), rate_limit_exceeded (429). The full table is on the Scribe API errors page.