SDK Overview & Installation
The Woolf SDK enables real-time tracking of student activities within your LMS, ensuring compliance with Woolfβs Academic Management System (AMS). The SDK automates the capture of educational events - such as resource consumption, attendance, submissions, and grading, and synchronizes them with Woolfβs accreditation workflows.
π Access Woolf's Latest SDK
Key Capabilities
Tracks resource consumption across PDFs, videos, markup, and other media
Captures assignment submissions and meeting attendance with verifiable evidence
Synchronizes grades and feedback from teachers with AMS records
Signs events in real time to support compliance and verification
Provides secure, extensible access via a modern JavaScript client
π‘ All events require correct user context. Authorize the SDK using a User Token to track actions reliably.
Supported Environments
The SDK and API work across multiple deployment environments:
Environment | Env Key | Purpose |
|---|---|---|
|
| Production environment for live data |
|
| Testing environment with test tokens and data |
Installation Options
Option 1: CDN Installation (Recommended)
Load the SDK in your LMS directly via a script tag. This ensures youβre always using the latest version:
const initialiseWoolf = (token, namespace = "university") => { const options = encodeURIComponent(JSON.stringify({ env: namespace })); const script = document.createElement("script"); script.type = "module"; script.src = `https://sdk.woolf.university/v1/latest?token=${token}&options=${options}`; document.addEventListener("woolf:created", (event) => { const woolf = event.woolf; console.log(woolf.user); // Authenticated user }); document.head.appendChild(script); }; // Example usage: initialiseWoolf("USER_TOKEN"); // Production // initialiseWoolf("USER_TOKEN", "sandbox"); // Sandbox
Alternatively, configure via window.woolfOptions:
window.woolfOptions = { env: "sandbox" }; // before script loads
Option 2: NPM Installation
Install the SDK into your frontend app:
npm i -S @woolfuniversity/sdk
Then initialize the SDK with a valid user token:
import { Woolf } from "@woolfuniversity/sdk"; const woolf = await Woolf.create("USER_TOKEN", { env: "university", // or "sandbox" widget: { renderOnInit: true }, tracker: { trackPage: (url) => url.pathname.split("/").pop() // optional } }); console.log(woolf.user);
Generating a User Token
Each user must be authenticated using a User Token signed with your College Secret.
Sign JWT on Your Server (Recommended)
You may generate tokens server-side with JSON Web Tokens (JWT). It gives you complete control over token lifetime, revocation, and security.
import jwt from "jsonwebtoken"; const COLLEGE_SECRET = "YOUR_SECRET_KEY"; const token = jwt.sign({ id: "USER_ID", collegeId: "COLLEGE_ID" }, COLLEGE_SECRET); console.log("User Token:", token);
Generate via Woolf API
Alternatively, you may also generate a token using our API endpoint.
β οΈ Tokens generated using API expire after 7 days. For more control, it is recommended to use server-side JWT signing.
Β
π Do not expose your College Secret in frontend code. Always sign tokens on the server.
After Initialization
The
woolf.userobject becomes available for accessing user profile data.The
woolf.widgetinterface allows programmatic control of onboarding and dashboard flows.Use methods like
woolf.trackSubmission,trackAttendance,trackGrade, andtrackFeedbackto log events.The SDK emits a
woolf:createdevent on successful initialization.