@lxpack/spa-bridge
v0.7.0
Published
Typed parent/child SDK for LXPack SPA lessons (lxpackBridge.v1)
Maintainers
Readme
@lxpack/spa-bridge
Typed parent/child SDK for LXPack SPA lessons (window.parent.lxpackBridge.v1).
Part of LXPack. Docs: SPA bridge reference · API stability.
| Related | Package |
|---------|---------|
| Browser runtime | @lxpack/runtime |
| LessonKit meta-package | @lxpack/lessonkit |
| Example SPA course | examples/lessonkit-spa |
Install
npm install @lxpack/spa-bridgeRequires Node.js 18 or 20 (18+) for the build toolchain.
Usage (SPA child)
import { getLxpackBridge } from "@lxpack/spa-bridge";
const bridge = getLxpackBridge();
bridge?.completeLesson("my_spa_lesson");
bridge?.submitAssessment({ id: "quiz", score: 0.9, maxScore: 10 });
bridge?.track({ type: "interaction", id: "my_spa_lesson", data: { done: true } });Development
From the monorepo root:
pnpm --filter @lxpack/spa-bridge build
pnpm --filter @lxpack/spa-bridge test
pnpm --filter @lxpack/spa-bridge typecheckLinks
License
Apache-2.0
