Built for real classrooms. Online and offline.

The AfriLearn Connect SDK helps developers integrate attendance, learning records, and content sync into school apps that work reliably in low‑connectivity environments.

v1.0.1 MIT Offline‑first

Quickstart

  1. Install the SDK (or clone the repo).
  2. Initialize with your API key.
  3. Make your first call in under 10 minutes.

Install

npm install afrilearn-sdk

Initialize

import AfriLearn from './afrilearn-sdk.js';

const sdk = new AfriLearn({
  baseUrl: 'https://api.afrilearn.org/v1',
  apiKey: 'YOUR_API_KEY'
});

Fetch performance

const perf = await sdk.getStudentPerformance('STU-KE-2025');
console.log(perf);

Submit attendance

await sdk.postAttendance({
  classId: 'CLS-101',
  date: '2025-10-04',
  attendanceList: [
    { studentId: 'STU-001', present: true },
    { studentId: 'STU-002', present: false }
  ]
});
Note: The SDK includes local caching and a sync queue to keep data flowing when devices go offline.

API Reference (preview)

GET

/students/{studentId}/performance

Retrieve a student's performance across available terms and subjects.

Example response
[
  { "subject": "Mathematics", "score": 84, "term": "Term 1" },
  { "subject": "Science", "score": 79, "term": "Term 2" }
]
POST

/classes/{classId}/attendance

Submit attendance for a given class and date.

Example request body
{
  "date": "2025-10-04",
  "records": [
    { "studentId": "STU-001", "present": true },
    { "studentId": "STU-002", "present": false }
  ]
}

Full API docs will be available at developers.afrilearn.org/docs.

Examples

Attendance Demo (Node)

const AfriLearn = require('afrilearn-sdk');
const sdk = new AfriLearn({ apiKey: process.env.AFRILEARN_API_KEY });

await sdk.postAttendance({ classId: 'CLS-101', date: '2025-11-04', attendanceList: [] });
await sdk.syncOffline();

Performance Dashboard (Node)

const perf = await sdk.getStudentPerformance('STU-KE-2025');
render(perf);

Changelog

  • v1.0.1 – 23 October 2025

    Improved offline sync queue; Swahili localization for errors; new examples.

  • v1..0 – 7 September 2025

    Initial release: core modules (Attendance, Performance, Sync).

Contact & Community

Maintained by Webworks Africa Limited · Nairobi. Join the community, suggest features, or report issues.