skillsphere-scorm-api-wrapper
v1.0.0
Published
This is SkillSphere scorm api wrapper for both 1.2 and 2004 versions
Maintainers
Readme
📚 SkillSphere SCORM Library
A lightweight, configurable, and framework-agnostic SCORM 1.2/2004 player library built with TypeScript. SkillSphere makes it easy to integrate SCORM tracking into React, Vue, Angular, or plain JavaScript projects with minimal setup.
Features
✅ Supports SCORM 1.2 (2004 support coming soon)
✅ Global namespace: SkillSphere
✅ Easy-to-use config system (debug, log levels, auto-commit, etc.)
✅ Strong TypeScript typings
✅ Framework-agnostic (works in React, Vue, Angular, Vanilla JS)
✅ Extensible API wrapper for LMS communication
✅ Safe logging with built-in debug tools
Installation
npm install skillsphere-scorm-api-wrapper
or with yarn
yarn add skillsphere-scorm-api-wrapper
🛠️ Usage
Basic example
import { SkillSphere } from "skillsphere-scorm-api-wrapper";
// configure
SkillSphere.config.set({
scormVersion: "1.2",
debug: true,
logLevel: "warn",
});
// init with SCORM API handle (usually provided by LMS)
const initialized = SkillSphere.scorm.init(window.API_1484_11); // for SCORM 2004
// OR const initialized = SkillSphere.scorm.init(window.API); // for SCORM 1.2
if (initialized) {
const score = SkillSphere.scorm.getAPI().getValue("cmi.score.raw");
SkillSphere.scorm.getAPI().setValue("cmi.score.raw", "85");
SkillSphere.scorm.getAPI().commit();
SkillSphere.scorm.terminate();
}⚙️ Configuration
SkillSphere provides global config options:
| Option | Type | Default | Description | | :------ | :----: | :------: | :---------- | | scormVersion | "1.2" or "2004" | "1.2" | Select SCORM version | | debug | boolean | true | Enable/disable debug logs | | logLevel | "info"/"warn"/"error" | "info" | Minimum log level shown | | autoCommit | boolean | true | Auto-commit data after setValue |
Update config at runtime:
SkillSphere.config.set({ debug: false, logLevel: "error" });
