Deployment guide¶
Ship LessonKit courses to learners via LMS packages or standalone hosting.
Deployment targets¶
Target |
Artifact |
Typical hosting |
|---|---|---|
|
ZIP |
LMS upload (widest compatibility) |
|
ZIP |
LMS with SCORM 2004 player |
|
ZIP |
xAPI-enabled platform + LRS |
|
ZIP |
cmi5 AU launch + LRS |
|
Directory or zip |
CDN, static bucket, internal web server |
Build and package:
npm run build
npm run package:scorm12 # or scorm2004, xapi, cmi5, standalone
Default SCORM path: .lxpack/course/.lxpack/out/course-scorm12.zip. See LMS Go-Live — SCORM output layout.
Runtime configuration matrix¶
Target |
|
|
Proxy env vars |
Observability hooks |
|---|---|---|---|---|
SCORM / xAPI / cmi5 (iframe) |
|
Required in production |
|
All required when delivery enabled — see production checklist |
Standalone static host |
|
Omit |
Same if reporting to LRS/analytics |
Same when delivery enabled |
Local |
|
Not required |
Optional |
Console sinks OK |
CORS and proxy requirements¶
Browser requests from the packaged SPA must reach your backend proxies, not the raw LRS with embedded credentials:
VITE_ANALYTICS_URL— POST batch telemetry; proxy should allow course origin and validate auth server-sideVITE_XAPI_PROXY_URL— POST xAPI statements; issue short-lived tokens from your backend
Configure CORS on proxies for the static host origin (standalone CDN) or rely on same-origin LMS iframe paths (SCORM).
Discovering allowedParentOrigins¶
Launch the course in LMS SCORM preview
Open browser devtools → inspect parent frame URL or
document.referrerAdd the origin (scheme + host + port) to
allowedParentOriginsRebuild and re-package
Pre-flight checklist¶
lxpack.bridge: "auto"andallowedParentOriginsincourseConfig.tsfor LMS iframe targets.Proxy URLs — set
VITE_ANALYTICS_URLandVITE_XAPI_PROXY_URLin.envbefore production build; never embed LRS secrets in the client bundle.Observability hooks — wire all required
config.observabilitycallbacks. See production checklist.ID parity — React
courseId/checkIdvalues matchlessonkit.json.HTTPS activity IRI —
tracking.xapi.activityIriinlessonkit.jsonmust be HTTPS for xAPI/cmi5 packaging.
Backend proxy pattern¶
LessonKit courses call your backend proxies from the browser:
Browser SPA ──► /api/telemetry/batch ──► your analytics store
Browser SPA ──► /api/xapi/statements ──► your LRS (short-lived token)
Use createFetchBatchSink and createFetchTransport from @lessonkit/xapi. Issue short-lived tokens server-side—see .env.example in the init template.
Standalone hosting¶
npm run package:standaloneUpload
.lxpack/course/.lxpack/out/standalone/to your static host (S3 + CloudFront, Azure Static Web Apps, nginx, etc.).Set
lxpack.bridge: "off"(no LMS parent).Configure xAPI/telemetry proxies if you report to an LRS.
SCORM upload checklist (LMS admin)¶
Import the ZIP the CLI printed
Launch in SCORM preview; confirm course loads (no blank screen—check browser console)
Complete an assessment; confirm completion/score in LMS gradebook
Note: single-SPA export—navigation is inside the package (one SCO)
CI/CD¶
Pin @lessonkit/* versions. Typical pipeline:
npm ci
npm run build
npm run package:scorm12 -- --json
Upload the artifact from outputPath in JSON output. Run lessonkit package on Node 18+.