Litedirecte is a fast, easy-to-use, complete and fully tree-shakable TypeScript/JavaScript SDK for interacting with the private EcoleDirecte API.
Whether you are building Discord bots, native mobile apps, web apps, or others, Litedirecte handles all the messy stuff so you can focus on building what matters.
- 🌳 Tree-shakeable | Import only what you use.
- 🚪 Fully auto auth | GTK cookies, tokens, 2FA, and token refreshes are fully managed silently.
- 🛣️ Built-in proxy support | Perfect for running directly in browsers (bypassing CORS).
- 🛜 Offline | Built-in offline action queues and auto-caching.
- ⚡ Instant reads | Every read goes through an always-on cache (
getAll, built-in polling,watch, one sync status). Results are shared: treat them as read-only. - 🎓 Rich feature set | Fully supports grades, timetable, homework, messages, attendance, cloud, QCM and more. Parent account support coming this year!
- 🌐 Available everywhere | Works flawlessly on Node.js 18+, Bun, Deno, modern browsers*, Cloudflare Workers, React Native, Capacitor, Electron, etc.
- 🔒 Secure | Zero password stored; supports AES-GCM data encryption.
Get Litedirecte up and running in under a minute!
Using npm:
npm install litedirecteUsing Bun:
bun add litedirecteLet Litedirecte log you in, handle token storage, and coordinate security questions:
import { Litedirecte } from "litedirecte";
const ld = new Litedirecte({ maxRetries: 2 });
const result = await ld.auth.login("your_username", "your_password", {
rememberMe: true, // Auto-saves session for seamless subsequent loads
on2faRequired: async (question, choices) => {
console.log("EcoleDirecte Security Question:", question);
console.log("Choices:", choices);
// Choose your answer: return either the choice index (number) or text (string)
return 0; // Selects the first choice
}
});
if (result.type === "success") {
console.log(`Success! Logged in as ${result.user.prenom} ${result.user.nom}`);
}Once authenticated, call any of Litedirecte's modular methods. You never need to handle authorization tokens manually again:
import { Litedirecte } from "litedirecte";
const ld = new Litedirecte();
await ld.auth.login("your_username", "your_password");
const gradesResult = await ld.grades.getGrades();
console.log(`Loaded ${gradesResult.notes.length} grades!`);
if (gradesResult.notes.length > 0) {
console.log(`Latest grade: ${gradesResult.notes[0].valeur}/${gradesResult.notes[0].noteSur}`);
}
// Each instance is independent: two clients never share tokens, queues or timers.
const other = new Litedirecte({ storageNamespace: "other:" });
await other.auth.loadSession();
// Always clean up timers and listeners when done:
ld.destroy();
other.destroy();For full instructions, configuration guides, and references, explore the project wiki.
Litedirecte is licensed under the Affero General Public License v3 (AGPL 3.0).
This means if you utilize Litedirecte inside a project and make it publicly available (such as an executable download, mobile application, or web/server service), you must make your project open-source under that same license.
Tip
For projects already under GPL 3.0, you don't have to change your license! GPL and AGPL are fully compatible. You are only required to use AGPL if you host Litedirecte on a server.
This project is an independent third-party development and is not affiliated or sponsored in any way with Aplim or EcoleDirecte.
Caution
LITEDIRECTE MIGHT HANDLE MINORS' DATA. ALWAYS ASK FOR PARENT CONSENT BEFORE STORING ANYWHERE OR PROCESSING DATA THROUGH SERVERS.
Made with ❤️ by typeof (Scolup)
*Chromium only works when the proxy is enabled.