Skip to content

Scolup/Linkdirecte

Repository files navigation

Linkdirecte, your first-rate SDK for working with EcoleDirecte data.

badge group

Linkdirecte 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, Linkdirecte handles all the messy stuff so you can focus on building what matters.


⭐️ Key Features

  • 🌳 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 | Local cache and built-in offline action queues.
  • 🎓 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.

🚀 Quick Start

Get Linkdirecte up and running in under a minute!

1. Install the SDK

Using npm:

npm install linkdirecte

Using Bun:

bun add linkdirecte

2. Log In Easily

Let Linkdirecte log you in, handle token storage, and coordinate security questions:

import { login } from "linkdirecte";

const result = await 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}`);
}

3. Fetch Student Data

Once authenticated, call any of Linkdirecte's modular methods. You never need to handle authorization tokens manually again:

import { getGrades } from "linkdirecte";

const gradesResult = await 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}`);
}

📖 Documentation

For full instructions, configuration guides, and references, explore the project wiki.


⚖️ License & Legal

Linkdirecte is licensed under the Affero General Public License v3 (AGPL 3.0).

This means if you utilize Linkdirecte 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 Linkdirecte 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

LINKDIRECTE MIGHT HANDLE MINORS' DATA. ALWAYS ASK FOR PARENT CONSENT BEFORE STORING ANYWHERE OR PROCESSING DATA THROUGH SERVERS.


Made with ❤️ by typeof (Scolup)

Releases

Used by

Contributors

Languages