Heidi widget
Initialisation options

Recommended configuration

const heidiOptions = {
  token: 'JWT_TOKEN',
  target: '#heidi',
  region: 'AU',
  productName: 'Your EMR Name',
  display: {
    position: 'bottom-right',
  },
  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

AttributeValue
OptionalNo
DefaultN/A
DescriptionA valid JWT token obtained from the Heidi Authentication API.

target

AttributeValue
OptionalYes
Defaultdocument.body
DescriptionA target DOM element to render the widget into.

region

AttributeValue
OptionalYes
DefaultAU
DescriptionA valid code to indicate what Heidi API region to use: AU, EU, UK, US.

productName

AttributeValue
OptionalYes
DefaultN/A
DescriptionThe name of your EMR product. This is shown to users during the Heidi signup process.

onInit

AttributeValue
OptionalYes
DefaultN/A
DescriptionCalled when Heidi is successfully initialised. This is called as soon as the script is successfully loaded on your page.

onReady

AttributeValue
OptionalYes
DefaultN/A
DescriptionCalled when the Heidi widget is ready for use. This is called after Heidi.open() is triggered.

display

AttributeValue
OptionalYes
DefaultN/A
DescriptionDisplay options for the widget. See below.

result

AttributeValue
OptionalYes
DefaultN/A
DescriptionResult Options for the widget. See below.

Display Options

theme

AttributeValue
OptionalYes
Defaultlight
DescriptionThe default Heidi Widget theme.

position

AttributeValue
OptionalYes
Defaultbottom-right
DescriptionSets the position of the widget on the page. Accepted values are: top-left, top-right, bottom-right, bottom-left

maxHeight

AttributeValue
OptionalYes
Default800
DescriptionSets the maximum height for the widget when it's fully expanded. Minimum recommended is 500px, hover any value will work.

fitToWindow

AttributeValue
OptionalYes
Defaultfalse
DescriptionIf set to true, the widget will resize to fill the entire height and width of the window. The maximum width it's set to 350px however it will resize and fit any height.

paddingX

AttributeValue
OptionalYes
Default24
DescriptionDistance of the widget from the window edge (on the X axis - left or right).

paddingY

AttributeValue
OptionalYes
Default24
DescriptionDistance of the widget from the window edge (on the Y axis - top or bottom).

draggable

AttributeValue
OptionalYes
Defaultfalse
DescriptionAllow the widget to be dragged around the page by the user.

zIndex

AttributeValue
OptionalYes
Default'10000'
DescriptionChange the zIndex of the widget frame.

Result Options

includeTranscript

AttributeValue
OptionalYes
Defaultfalse
DescriptionOption to include transcript to the pushData response.