https://github.com/jacoblincool/moodle-api
The easiest way to use the Moodle API with fully typed parameters and responses.
https://github.com/jacoblincool/moodle-api
Last synced: over 1 year ago
JSON representation
The easiest way to use the Moodle API with fully typed parameters and responses.
- Host: GitHub
- URL: https://github.com/jacoblincool/moodle-api
- Owner: JacobLinCool
- License: agpl-3.0
- Created: 2023-09-19T11:13:36.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-23T19:13:14.000Z (over 1 year ago)
- Last Synced: 2025-02-15T09:07:42.224Z (over 1 year ago)
- Language: TypeScript
- Homepage: http://jacoblin.cool/moodle-api/
- Size: 3.11 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Moodle API
The easiest way to use the Moodle API with fully typed parameters and responses.
## Example

```ts
import { MoodleClient, login } from "moodle-api";
const token = await login(
process.env.MOODLE_URL,
process.env.MOODLE_USERNAME,
process.env.MOODLE_PASSWORD,
);
const client = new MoodleClient(process.env.MOODLE_URL, token);
const info = await client.call("core_webservice_get_site_info");
console.log("Supported Functions:", info.functions.map(f => f.name));
```