Skip to content

Install

We provide two ways to incorporate VimOS.js into your application: Via a script tag in your html, and via a public npm package.

Script tag

Include the VimOS.js script on each page of your application to incorporate VimOS.js into your application. It should always be loaded directly from connect.getvim.com rather than included in a bundle or hosted yourself.

html
<head>
  ...
  <script src="https://connect.getvim.com/vim-os-sdk/v1.x.x/vim-sdk.umd.js"></script>
  ...
</head>
<body>
  ...
</body>

tip

TIP

  • If you are building a multi page application, you should include the script on each page of your application, not just the main page.
  • Make sure to add the script tag before any script code that uses VimOS.js; this ensures VimOS.js is loaded when your code uses it.

NPM

We also provide an alternative method to incorporate VimOS.js with an npm package making it easier to load and use VimOS.js as a module. Using the npm package allows you also to leverage TypeScript powerful auto-completion capabilities. When working with TypeScript in an integrated development environment (IDE) such as Visual Studio Code, the IDE can use the type information defined in VimOS.js npm package to offer auto-completion suggestions.

To use VimOS.js as a module and leverage TypeScript auto-completion capabilities, you can install it in your tech stack like this:

bash
npm install vim-os-js-browser
bash
yarn add vim-os-js-browser
bash
pnpm add vim-os-js-browser

minimum requirements

INFO

VimOS.js TypeScript works with TypeScript V5 and above.

Asynchronous and deferred loading of VimOS.js

Asynchronous loading of JavaScript is generally recommended, as it can improve your application user experience by not blocking DOM rendering during script loading. The easiest way to asynchronously load VimOS.js is to use the npm module. It does asynchronous loading by default.

Suppose you use the script tag method to integrate VimOS.js into your code stack. In that case, we recommend not to set the async attribute in the script tag, to ensure that VimOS.js is loaded synchronously before it is called in your application code, avoiding timing issues and ensuring that VimOS.js functions as expected.

If you prefer to load VimOS.js using the async or defer attribute on the script tag, you will need to make sure that any API calls to VimOS.js are made only after the script execution is completed. You can do so by checking for the existence of vimSdk on the window:

ts
  if (window.vimSdk) {
    ...
  }

Next: Authentication, Vim EHR Connectivity and Vim Hub

  1. Authentication: Integrate your application securely to ensure authorized access to Electronic Health Record (EHR) resources and obtain access to the active session context.

  2. Vim EHR Connectivity: Vim’s EHR-Connectivity gives you the ability to not only connect to the most popular EHRs, it allows you to leverage all its existing features and functionality such as read/write access to the EHR, workflow resources and their associated data. Additionally, any new features and functionality will be made available to you automatically.

  3. Vim Hub: Vim Hub is the Vim Connect UI, which your users will experience when working in the EHR after you have built and deployed your application. Vim designed its Vim Hub features to provide an engaging and intuitive end-user experience that reduces administrative burden.