Home

Compass.JS

API Client for Compass Education written in JavaScript and typed with JSDoc

JavaScript Badge npm Badge Singapore Airlines Badge

Resources

NPM Package: https://www.npmjs.com/package/@idkfelix/compass.js
GitHub Repo: https://github.com/idkfelix/compass.js
Compass Website: https://www.compass.education/

Installation

Install the latest version from npm locally and save it in your project's package.json file:

$ npm install --save @idkfelix/compass.js

Example Usage

Initialise a new Compass client and console log the returned user info:

index.js

import CompassClient from '@idkfelix/compass.js';
import 'dotenv/config';

(async()=>{
  let cookie = process.env.COOKIE
  if(!token) throw new Error('Error: No cookie')
  const client = await CompassClient('example.compass.education',cookie);
  console.log(client.userInfo);
})();

.env

COOKIE='ASP.NET_SessionId=...'

Services and Locations

Accounts.svc

  • /GetAccount

Activity.svc

  • /GetLessonsByActivityId
  • /GetLessonsByActivityIdQuick
  • /GetLessonsByInstanceId
  • /GetLessonsByInstanceIdQuick

Calendar.svc

  • /GetCalendarEventsByUser

LearningTasks.svc

  • /GetAllLearningTasksByUserId
  • /GetAllLearningTasksByActivityId

TaskService.svc

  • /GetTaskItems
  • /GetAllTaskItems
  • /SaveTaskItem
  • /DeleteTaskItem
  • /UpdateTaskItem

Users.svc

  • /GetAllStaff