Getting Started

The library has been configured to work in multiple environments:

  • UMD (Browser)

  • ESM (Client-side applications)

UMD (Browser)

<script src="https://unpkg.com/@xapi/cmi5"><script>
<script type="text/javascript">
// Create Cmi5 instance
const cmi5 = new Cmi5();
// Initialize AU
cmi5.initialize();
<script>

ES module (Client-side applications)

For client-side applications built using imports, an ES Module is available for you to install and import into your project.

npm i @xapi/cmi5 --save
import Cmi5 from "@xapi/cmi5";
// Create Cmi5 instance
const cmi5: Cmi5 = new Cmi5();
// Initialize AU
cmi5.initialize();