@lxpack/xapi
v0.7.0
Published
xAPI statement builders and transport for LXPack
Maintainers
Readme
@lxpack/xapi
xAPI 1.0.3 helpers for LXPack: statement types, ADL verb builders, cmi5/xAPI launch param parsing, LRS transport, and Tin Can tincan.xml generation.
Part of LXPack. Docs: Export to LMS · Tracking and completion · course.yaml — tracking.xapi.
| Related | Package |
|---------|---------|
| CLI build | @lxpack/cli (lxpack build --target xapi) |
| Packaging | @lxpack/scorm |
| Runtime analytics | @lxpack/runtime |
| cmi5 manifests | @lxpack/cmi5 |
Example course: examples/xapi-awareness · example README.
Install
npm install @lxpack/xapicmi5 fetch bootstrap
When a cmi5 launch URL includes fetch=..., call bootstrapCmi5LaunchParams() (or fetchCmi5AuthToken()) before sending statements. The AU must POST to the fetch URL (GET is not allowed per the cmi5 spec). The JSON response must include auth-token, which is sent as the xAPI Authorization header on subsequent LRS requests. Tokens are cached in sessionStorage keyed by fetch URL to survive page refresh without re-posting.
Development
From the monorepo root:
pnpm --filter @lxpack/xapi build
pnpm --filter @lxpack/xapi testLinks
License
Apache-2.0
