Creating SCORM courses with Sanity and available options discussed
While there isn't a documented example in the Sanity community of someone building SCORM packages with Sanity, it's definitely technically feasible! I found a discussion from 2021 where someone had the exact same question, and the consensus was that it should be possible since Sanity can model any object/array structure.
The main challenge is that SCORM packages require specific XML files (like imsmanifest.xml) and a particular folder structure, while Sanity stores content as JSON. Here's how you could approach this:
Using Sanity as Your Content Source
Sanity would be perfect for managing your course content - lessons, quizzes, media assets, etc. You'd define schemas for your course structure and use Sanity Studio as your authoring environment. The React-based Studio is already the kind of modern editing experience you're looking for.
Generating SCORM Packages
For the actual SCORM package creation, you'll need to:
Build a React frontend that queries your content from Sanity using GROQ
Add SCORM runtime libraries - Look into npm packages like:
scorm-again- A modern SCORM runtimereact-scorm-provider- React wrapper for SCORM APIsimple-scorm-packager- For generating the final zip package
Use Sanity Functions or a build script to:
- Fetch your course content from Sanity
- Transform the JSON to the required SCORM XML format
- Generate the
imsmanifest.xmlfile - Bundle everything into a SCORM-compliant zip package
Alternative Approach
You could also use Sanity's Content Lake to store all your course content, then build a separate Node.js script that:
- Queries the content via Sanity's APIs
- Generates static HTML/JS files for your course
- Creates the SCORM package structure programmatically
The JSON-to-XML conversion is straightforward with libraries like xml2js or fast-xml-parser. The key is understanding the SCORM specification requirements for your target version (SCORM 1.2 vs 2004).
Since you mentioned this is for the Norwegian public sector, make sure you verify which SCORM version they require - that'll determine the exact manifest structure you need to generate.
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.