API reference¶
LessonKit publishes TypeScript declarations on npm (dist/*.d.ts) and documents behavior in the guides below.
Guides vs reference
Read this when… |
Start here |
|---|---|
Learning workflows (first course, LMS export, theming) |
|
Validating props, IDs, manifest fields, CLI flags |
Reference pages on this site (below) + Block catalog |
TypeScript signatures only |
TypeDoc (built on Read the Docs; regenerate locally with |
TypeDoc lists signatures — high-traffic exports include @example blocks in source (regenerate with npm run docs:api). For behavior, prefer narrative guides first, then reference contracts.
When TypeDoc and guides disagree
When TypeDoc and guides disagree, the narrative guide wins until the release noted in CHANGELOG. File an issue if TypeDoc shows a public export with no guide coverage.
Before opening a GitHub issue for API usage: Check Components and hooks, the relevant component page, and narrative references below. TypeDoc signatures alone are not the supported learning path for runtime behavior.
Generated API (TypeDoc)
Browse generated TypeScript API docs (built with the docs site on Read the Docs). Each row links TypeDoc to the narrative guide to read first.
Package |
Generated reference |
Narrative guide |
|---|---|---|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Packaging API highlights
Export |
Package |
Narrative |
|---|---|---|
|
|
|
|
|
|
|
|
Full index: TypeDoc home.
Monorepo maintainers regenerate locally: npm run build:packages && npm run docs:api. TypeDoc output lives under docs/_static/typedoc/ and is generated on Read the Docs — local Sphinx builds show broken TypeDoc links until you run docs:api. See Contributing — TypeDoc generation.
Also use:
IDE —
Go to Definitionon@lessonkit/reactimports in a scaffolded projectStorybook — component states and props visually
Narrative guides — Components and hooks · Block catalog
Interactive
Resource |
URL |
|---|---|
Storybook (component states) |
GitHub Pages · |
Live course demos |
Packages
Package |
Types |
Narrative docs |
|---|---|---|
|
|
|
|
Block components only (tree-shake friendly) |
|
|
Test reset helpers (see table below) |
|
|
|
|
|
Headless test reset helpers (see table below) |
|
|
|
|
|
Packaging API |
|
|
Theme presets and tokens |
|
|
Focus and motion utilities |
@lessonkit/react/testing exports
Export |
Purpose |
|---|---|
|
Clear Quiz dev warnings between tests |
|
Clear assessment guard warnings |
|
Reset lesson mount registry |
|
Clear compound child validation warnings |
|
Clear session storage used by provider |
|
Reset course_started delivery flight state |
@lessonkit/core/testing exports
Export |
Purpose |
|---|---|
|
Clear telemetry builder dev warnings |
|
Reset default storage port |
|
Reset tab session id helper state |
|
Reset headless course_started emit flight |
Prefer these subpaths over deprecated main-entry reset helpers.
Import from @lessonkit/core (re-exported by @lessonkit/react where relevant):
Type |
Purpose |
|---|---|
|
Props shape for |
|
|
Production guardrails
API |
Package |
Purpose |
|---|---|---|
|
|
Throws in production when console telemetry/xAPI sinks, tracking enabled without delivery, or required observability hooks are missing |
|
|
Returns false in test mode ( |
|
|
Required when xAPI delivery is configured; called when transport fails after retries (statement re-queued) |
See the production checklist for the full observability hook matrix (1–6 hooks depending on tracking/xAPI configuration).
Framework 1.5 blocks
Export from @lessonkit/react: BranchingScenario, BranchNode, BranchChoice, Embed, Chart, useBranchingScenario. See Block catalog — 1.5 and Migration 1.4 → 1.5.
Framework 1.6 blocks
Export from @lessonkit/react / @lessonkit/react/blocks (catalog v3, framework 1.6.0+):
Block |
Role |
|---|---|
|
Content |
|
Assessment ( |
|
Compound (spatial map; |
Full prop contracts: Block catalog — 1.6.0 · generated prop tables. Discover blocks from CLI: lessonkit blocks list --json.
Framework 1.7 blocks
Export from @lessonkit/react / @lessonkit/react/blocks (catalog v3, framework 1.7.0+):
Block |
Role |
|---|---|
|
Assessment ( |
|
Compound (child |
Quiz / KnowledgeCheck variants: answers, shuffleChoices, shuffleSeed, choiceFeedback — see Migration 1.6 → 1.7.
Full prop contracts: Block catalog — 1.7.0 · generated prop tables.
Machine-readable contracts
Artifact |
Package path |
|---|---|
Block catalog v1–v3 |
|
Block contract v1–v3 |
|
Telemetry catalog |
|
Identity contract |
|
See Block catalog and Glossary for version naming.
IDE tips
In a scaffolded course, run npm run dev and use Go to Definition on imports from @lessonkit/react. For headless APIs (createLessonkitRuntime, plugins), import from @lessonkit/core directly. In tests, prefer @lessonkit/react/testing and @lessonkit/core/testing over deprecated main-entry reset helpers.