Skip to content
Kamil Baraniak edited this page Oct 2, 2023 · 4 revisions

How to use library

const { LibrusAPI } = require("librus-api-rewrited");
const librusApi = new LibrusAPI();

Example File

const { LibrusAPI } = require('../api');

async function main() {
  try {
    const librusApi = new LibrusAPI();
    const tokenCreated = await librusApi.mkToken('synergia_login', 'synergia_password');
    console.log('Token Created:', tokenCreated);
    if(tokenCreated){
      librusApi.getLessons()
      librusApi.getAPI("SystemData")
    }
  } catch (error) {
    console.error('Error:', error);
  }
}

main();
Clone this wiki locally