{"id":18665,"library":"pipwerks-scorm-api-wrapper","title":"Pipwerks SCORM API Wrapper","description":"Module wrapper for the Pipwerks SCORM API Wrapper, providing a clean ES6 module interface for LMS communication in e-learning content. Current version 0.1.2. Exposes SCORM object with init, get, set, save, quit methods plus debug and utilities. Intended for browser use in SCORM 1.2/2004 compliant LMS environments. Key differentiator: simplifies the original pipwerks API with ES module exports and npm distribution, avoiding global pollution.","status":"active","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/allanhortle/pipwerks-scorm-api-wrapper","tags":["javascript"],"install":[{"cmd":"npm install pipwerks-scorm-api-wrapper","lang":"bash","label":"npm"},{"cmd":"yarn add pipwerks-scorm-api-wrapper","lang":"bash","label":"yarn"},{"cmd":"pnpm add pipwerks-scorm-api-wrapper","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default import does not work; only named import is supported since v0.1.0.","wrong":"import SCORM from 'pipwerks-scorm-api-wrapper';","symbol":"SCORM","correct":"import { SCORM } from 'pipwerks-scorm-api-wrapper';"},{"note":"Package is ESM-only; CommonJS require is not supported.","wrong":"const { UTILS } = require('pipwerks-scorm-api-wrapper');","symbol":"UTILS","correct":"import { UTILS } from 'pipwerks-scorm-api-wrapper';"},{"note":"The package does not export the global pipwerks object; you must assign manually if needed for legacy code.","wrong":"import { pipwerks } from 'pipwerks-scorm-api-wrapper';","symbol":"pipwerks.SCORM","correct":"import { SCORM } from 'pipwerks-scorm-api-wrapper'; window.pipwerks = { SCORM };"}],"quickstart":{"code":"import { SCORM } from 'pipwerks-scorm-api-wrapper';\n\n// Initialize connection with LMS\nSCORM.init();\n\n// Get learner name\nconst studentName = SCORM.get('cmi.core.student_name');\nconsole.log('Student:', studentName);\n\n// Set lesson status to completed\nSCORM.set('cmi.core.lesson_status', 'completed');\n\n// Save data to LMS\nSCORM.save();\n\n// Terminate session\nSCORM.quit();","lang":"javascript","description":"Shows basic SCORM workflow: initialize, get student name, set lesson status, save, and quit."},"warnings":[{"fix":"Call SCORM.init() at the beginning of your script; ensure the page is loaded in an LMS window.","message":"SCORM.init() must be called before any get/set operations, typically on page load. Failing to do so results in silent failures.","severity":"gotcha","affected_versions":"*"},{"fix":"Use SCORM.isAvailable() to confirm connection, or check result !== ''.","message":"SCORM.get() returns empty string for undefined data model elements, not null or undefined. Compare against '' or check 'isAvailable'.","severity":"gotcha","affected_versions":"*"},{"fix":"Use import syntax in ESM context, or ensure bundler (webpack, rollup) resolves the module.","message":"Package is ESM-only (no CommonJS) since v0.1.0. Using require() throws 'ERR_REQUIRE_ESM' in Node.js.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Always pass string 'true' or 'false'; for numbers, use Boolean(Number(value)).","message":"UTILS.StringToBoolean expects 'true'/'false' strings; passing numeric 0/1 or boolean true/false causes unexpected results.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import { SCORM } from 'pipwerks-scorm-api-wrapper'; then use SCORM directly instead of pipwerks.SCORM.","cause":"Attempting to access global pipwerks object from script that doesn't create it.","error":"TypeError: pipwerks is undefined"},{"fix":"Switch to ES module import syntax: import { SCORM } from 'pipwerks-scorm-api-wrapper';","cause":"Using require() to load the ESM-only package.","error":"Error: ERR_REQUIRE_ESM"},{"fix":"Use import { SCORM } from 'pipwerks-scorm-api-wrapper';","cause":"Incorrect import (default import instead of named).","error":"TypeError: SCORM.init is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}