https://github.com/elisaado/somtoday.js
A JavaScript library for the SOMtoday REST API.
https://github.com/elisaado/somtoday.js
javascript rest school som somtoday typescript
Last synced: 9 months ago
JSON representation
A JavaScript library for the SOMtoday REST API.
- Host: GitHub
- URL: https://github.com/elisaado/somtoday.js
- Owner: elisaado
- License: mit
- Created: 2020-03-10T10:16:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-08T01:36:52.000Z (10 months ago)
- Last Synced: 2025-04-10T00:43:40.602Z (9 months ago)
- Topics: javascript, rest, school, som, somtoday, typescript
- Language: TypeScript
- Homepage:
- Size: 2.37 MB
- Stars: 12
- Watchers: 2
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SOMtoday.js
A JavaScript library for the SOMtoday REST API.
This project uses [the somtoday api docs](https://github.com/elisaado/somtoday-api-docs).
If you need any help with this project feel free to join our discord!
[](https://discord.gg/yE3e3erCut)
## Installation
Use either npm, or yarn to install the library to your project
`npm i somtoday.js --save`
`yarn add somtoday.js`
## Usage
Typescript example:
```ts
import somtoday from "somtoday.js";
async function main() {
const org = await somtoday.searchOrganisation({
name: "SCHOOL NAME HERE",
});
if (!org) throw new Error("School not found");
const user = await org.authenticate({
username: "SOMTODAY USERNAME",
password: "SOMTODAY PASSWORD",
});
const students = await user.getStudents();
console.log(students);
console.log(":D");
}
main();
```
Javascript example:
```js
const somtoday = require("../somtoday.js").default;
async function main() {
const org = await somtoday.searchOrganisation({
name: "SCHOOL NAME HERE",
});
if (!org) throw new Error("School not found");
const user = await org.authenticate({
username: "SOMTODAY USERNAME",
password: "SOMTODAY PASSWORD",
});
const students = await user.getStudents();
console.log(students);
console.log(":)");
}
main();
```