---
title: "Xapi Cmi5 Library"
description: "cmi5's difficulty is not the statements, it is the launch. An assignable unit is handed a set of URL parameters, has to exchange a fetch URL for an auth token, and must then send a specific sequence of statements with specific context activities and extensions or the LMS will not record the session correctly. @xapi/cmi5 does that for you: construct the class, call initialize(), and issue pass(), complete() or waive() at the right moments."
canonical_url: "https://scorm-tools.com/tools/xapi-cmi5-library"
last_updated: "2026-10-31T10:21:59.776Z"
---

cmi5's difficulty is not the statements, it is the launch. An assignable unit is handed a set of URL parameters, has to exchange a fetch URL for an auth token, and must then send a specific sequence of statements with specific context activities and extensions or the LMS will not record the session correctly. `@xapi/cmi5` does that for you: construct the class, call `initialize()`, and issue `pass()`, `complete()` or `waive()` at the right moments.

It is aimed at developers building custom or bespoke content — a JavaScript simulation, a React app, a game — that needs to run as a cmi5 AU. Strongly typed throughout, with interfaces for launch parameters, move-on conditions and performance criteria, so the compiler catches the shape errors that would otherwise appear as an LMS silently not registering completion. Four runtime dependencies, and a companion demo repository.

It will not help you author a package, validate cmi5.xml, or test without an LMS, and it does nothing for SCORM. If your content also has to run on a SCORM-only platform you will be maintaining two integration paths regardless.

Maintenance is the caveat worth sizing correctly. Twenty-three stars, five open issues, last release October 2024, last substantive commit before that. For a specification that has been stable since 2016 this is closer to "finished" than "abandoned", and the code is small enough to read in an afternoon and fork if needed. But if you need a fix, plan on making it yourself.
