Skip to main content

Variable: NablaConnect

const NablaConnect: object

The entry point of the SDK.

Type Declaration​

create​

create: (options) => NablaConnectClient

Creates a client for the Connect iframe and loads the encounter in it.

Parameters​

options​

NablaConnectOptions

The iframe and the encounter URL to load in it.

Returns​

NablaConnectClient

A client for the loaded encounter.

Remarks​

Synchronous: ready resolves with the first state. Render the <iframe> without a src: the SDK sets it. A new create on the same iframe ends the previous client with CONTEXT_CHANGED.

Throws​

TypeError when the iframe does not belong to a window.

Example​

const client = NablaConnect.create({ iframe, url: urlOfEncounter });
client.addEventListener("stateChanged", ({ detail: state }) => {
recordButton.disabled = !state.availableActions.includes("START_RECORDING");
});
await client.ready;