Widget
SDK specification
Initialisation options

Recommended configuration

const heidiOptions = {
  token: 'JWT_TOKEN',
  target: '#heidi',
  region: 'AU',
  productName: 'Your EMR Name',
  display: {
    position: 'bottom-right',
  },
  language: {
    inputDefault: 'en',
    outputDefault: 'en',
  },
  result: {
    includeTranscript: true,
  },
  onInit: () => {
    // Display the UI that will trigger Heidi
 
    document
      .querySelectorAll('.heidi-button')
      .forEach((button) => (button.style.display = 'block'));
  },
  onReady: () => {
    Heidi.onSessionStarted((sessionId) => {
      // sessionId is the ID of the current Heidi Session.
    });
 
    Heidi.onPushData((data) => {
      // data.notesData will contain data generated by Heidi
      // if a template was used, it will contain the result
      // using the Template structure above
 
      console.log(data);
    });
 
    Heidi.onPushDocument((data) => {
      // data.title and data.content will contain the document data generated by Heidi
 
      console.log(data);
    });
 
    Heidi.onTokenExpired(() => {
      // refresh the widget token when this callback is called to avoid losing recordings
      // the getToken function below should be replaced with your own logic to get a new token
 
      getToken().then((token) => {
        Heidi.setToken(token);
      });
    });
  }
};

All configuration options

token

A valid JWT token obtained from the Heidi Authentication API.

AttributeValue
OptionalNo
DefaultN/A

target

A target DOM element to render the widget into.

AttributeValue
OptionalYes
Defaultdocument.body

region

A valid code to indicate what Heidi API region to use.

AttributeValue
OptionalYes
DefaultAU
OptionsAU, EU, UK, US, CA

productName

The name of your EMR product. This is shown to users during the Heidi signup process.

AttributeValue
OptionalYes
DefaultN/A

onInit

Called when Heidi is successfully initialised. This is called as soon as the script is successfully loaded on your page.

AttributeValue
OptionalYes
DefaultN/A

onReady

Called when widget is ready for use. This is called after Heidi.open() is triggered.

AttributeValue
OptionalYes
DefaultN/A

result

Result Options for the widget.

const heidiOptions = {
  // ...
  result: {
    includeTranscript: true, // include transcript in the Heidi note data
  }
  // ...
}

language

Default language options for the widget.

const heidiOptions = {
  // ...
  language: {
    inputDefault: 'en', // the language the transcript will be interpreted with.
    outputDefault: 'en' // the default language a note and documents are generated with.
  }
  // ...
}

See supported languages for a complete list of supported languages.

display

Display options for the widget. See below.

Display Options

theme

The default widget theme.

AttributeValue
OptionalYes
Defaultlight
Optionslight, dark

position

Sets the position of the widget on the page.

AttributeValue
OptionalYes
Defaultbottom-right
Optionstop-left, top-right, bottom-right, bottom-left

maxHeight

Maximum height for the widget when it's fully expanded.

AttributeValue
OptionalYes
Default800
OptionsMinimum recommended is 500px, hover any value will work.

fitToWindow

If set to true, the widget will resize to fill the entire height and width of the window.

AttributeValue
OptionalYes
Defaultfalse

paddingX

Distance of the widget from the window edge (on the X axis - left or right).

AttributeValue
OptionalYes
Default24

paddingY

Distance of the widget from the window edge (on the Y axis - top or bottom).

AttributeValue
OptionalYes
Default24

draggable

Allow the widget to be dragged around the page by the user.

AttributeValue
OptionalYes
Defaultfalse

zIndex

Change the zIndex of the widget frame.

AttributeValue
OptionalYes
Default'10000'