Skip to content
Back to skills

Scorm Xapi Interoperability

ASecurity

Implement e-learning interoperability standards including SCORM 1.2, SCORM 2004, Experience API (xAPI / Tin Can), and CMI5. Author compliant imsmanifest.xml packages, handle browser-to-LMS SCORM JavaScript API communication (LMSInitialize, LMSSetValue, cmi.core.lesson_status), emit xAPI Actor-Verb-Object statements, and synchronize with Learning Record Stores (LRS). Trigger when building e-learning courses, LMS integrations, or training tracking modules.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 29, 2026
ai-agentsjavascripttypescriptgojavanodeapidatabasebackend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 29, 2026

npx -y skills add hamzabellouch/agent-skills --skill scorm-xapi-interoperability --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Scorm Xapi Interoperability?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Scorm Xapi Interoperability
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hamzabellouch-scorm-xapi-interoperability/badge)](https://www.skillsdirectory.com/skills/hamzabellouch-scorm-xapi-interoperability)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: scorm-xapi-interoperability
metadata:
  category: EdTech and Learning Management Systems
description: Implement e-learning interoperability standards including SCORM 1.2, SCORM 2004, Experience API (xAPI / Tin Can), and CMI5. Author compliant imsmanifest.xml packages, handle browser-to-LMS SCORM JavaScript API communication (LMSInitialize, LMSSetValue, cmi.core.lesson_status), emit xAPI Actor-Verb-Object statements, and synchronize with Learning Record Stores (LRS). Trigger when building e-learning courses, LMS integrations, or training tracking modules.
compatibility: SCORM 1.2 / 2004 4th Ed, xAPI 1.0.3, CMI5 specification
---

# SCORM & xAPI Interoperability Skill Guide

This skill governs standard implementation of interactive e-learning communication protocols, SCORM packaging manifests, and xAPI statement streaming to Learning Record Stores (LRS).

---

## 1. E-Learning Standard Architectural Comparison

```text
+-----------------------+---------------------------------------+---------------------------------------+
| Feature               | SCORM (1.2 / 2004)                   | xAPI (Tin Can) / CMI5                 |
+-----------------------+---------------------------------------+---------------------------------------+
| Environment           | Browser iframe inside LMS only        | Anywhere (Web, Mobile, VR, Offline)   |
| Communication         | Window JavaScript object (`API_1484`) | REST API (HTTP JSON Statements)       |
| Data Model            | CMI data elements (pass/fail, score)  | Actor-Verb-Object + Context Extensions|
| Storage Target        | LMS Database                          | Learning Record Store (LRS)           |
+-----------------------+---------------------------------------+---------------------------------------+
```

---

## 2. Production Code Implementations

### A. SCORM 1.2 JavaScript Bridge Interface (Client-Side)

```javascript
class SCORM12Bridge {
  constructor() {
    this.api = this.findLMSAPI(window);
    this.isInitialized = false;
  }

  findLMSAPI(win) {
    let attempts = 0;
    while (!win.API && win.parent && win.parent !== win && attempts < 10) {
      attempts++;
      win = win.parent;
    }
    return win.API || null;
  }

  initialize() {
    if (!this.api) {
      console.warn("[SCORM] No LMS API found. Running in standalone preview mode.");
      return false;
    }
    const result = this.api.LMSInitialize("");
    this.isInitialized = result === "true";
    return this.isInitialized;
  }

  setScore(scoreRaw, min = 0, max = 100) {
    if (!this.isInitialized) return;
    this.api.LMSSetValue("cmi.core.score.raw", String(scoreRaw));
    this.api.LMSSetValue("cmi.core.score.min", String(min));
    this.api.LMSSetValue("cmi.core.score.max", String(max));
  }

  completeCourse(passed = true) {
    if (!this.isInitialized) return;
    const status = passed ? "passed" : "failed";
    this.api.LMSSetValue("cmi.core.lesson_status", status);
    this.api.LMSCommit("");
  }

  terminate() {
    if (!this.isInitialized) return;
    this.api.LMSFinish("");
    this.isInitialized = false;
  }
}
```

### B. xAPI Statement Dispatcher to LRS (TypeScript / Node.js)

```typescript
import axios from "axios";

export interface XAPIStatement {
  actor: {
    name: string;
    mbox: string; // e.g. "mailto:learner@example.com"
  };
  verb: {
    id: string; // e.g. "http://adlnet.gov/expapi/verbs/completed"
    display: { "en-US": string };
  };
  object: {
    id: string; // Activity IRI
    definition: {
      name: { "en-US": string };
      description: { "en-US": string };
    };
  };
  result?: {
    score?: { scaled: number; raw: number; min: number; max: number };
    success?: boolean;
    completion?: boolean;
    duration?: string; // ISO 8601 duration: e.g. "PT15M30S"
  };
}

export class LRSClient {
  constructor(
    private readonly endpointUrl: string,
    private readonly authKey: string,
    private readonly authSecret: string
  ) {}

  public async sendStatement(statement: XAPIStatement): Promise<string> {
    const credentials = Buffer.from(`${this.authKey}:${this.authSecret}`).toString("base64");

    const response = await axios.post(
      `${this.endpointUrl.replace(/\\/$/, "")}/statements`,
      statement,
      {
        headers: {
          "Content-Type": "application/json",
          "X-Experience-API-Version": "1.0.3",
          Authorization: `Basic ${credentials}`,
        },
      }
    );

    return response.data[0]; // Returns recorded statement UUID
  }
}
```

---

## 3. Best Practices Checklist

- [ ] **LMS API Discovery:** Always recurse through `window.parent` and `window.opener` up to 10 levels to locate the SCORM API instance in multi-frame LMS setups.
- [ ] **Commit Frequency:** Call `LMSCommit("")` only on major milestone events (chapter finish, quiz submit) to avoid overwhelming LMS backend databases.
- [ ] **xAPI IRIs:** Use official ADL vocabulary IRIs (e.g. `http://adlnet.gov/expapi/verbs/passed`) rather than ad-hoc custom verbs.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…