Skip to content
Woolf Help Center home
Woolf Help Center home

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

university

env: "university"

Production environment for live data

sandbox

env: "sandbox"

Testing environment with test tokens and data


Installation Options

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.

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.user object becomes available for accessing user profile data.

  • The woolf.widget interface allows programmatic control of onboarding and dashboard flows.

  • Use methods like woolf.trackSubmission, trackAttendance, trackGrade, and trackFeedback to log events.

  • The SDK emits a woolf:created event on successful initialization.


Explore More