Canvas API functions bundled as a NPM package for Node.js. Note: this package no longer supports CJS as of version 2.0.0. If you need CJS support, please use version 1.8.0.
These instructions will get you a copy of the project up and running on your local machine for use with your own API tokens and Canvas domains.
- Install Node LTS (20 or greater).
To use with NodeJS:
$ npm install node-canvas-api
Rename the sample.env
file to .env
and add your institution's domain and API access token.
Attached to the canvasAPI
are a bunch of functions.
Run the attached functions!
import { getSelf } from 'node-canvas-api'
getSelf().then(x => console.log(x))
import { getUsersInCourse, getOptions } from 'node-canvas-api'
getUsersInCourse(12345, getOptions.users.enrollmentType.student) // first argument is Canvas course ID
.then(students => console.log(students))
Contributions are welcome and greatly appreciated!
- Create an issue describing what contribution you are planning to make.
- Fork the repo.
- Add your contributions.
- Once you're happy with your contribution, open an pull request and I'll take a look.
This project is licensed under the MIT License.