infoeducatie-api-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

This is the TypeScript/JavaScript client for the api.infoeducatie.ro

Check the API repository at: https://github.com/infoeducatie/infoeducatie-api

Sample usage:

//typescript
import { InfoeducatieApi, Current } from "infoeducatie-api-client";
 
(async _ => {
    let api = new InfoeducatieApi();
    
    let current: Current = await api.authorize("your-key").getCurrent();
    if(current.is_logged_in) { // check is the current session is logged in
        console.log(current.user.email); // will print the email of the currently logged in user
    } else {
        console.log("Could not authorize against Infoeducatie's API");
    }
})();

The client works with javascript as well... but i recommend using it with typescript :)

//javascript
let { InfoeducatieApi } = require("infoeducatie-api-client");
 
(async _ => {
    let api = new InfoeducatieApi();
 
    let current = await api.authorize("your-key").getCurrent();
    if(current.is_logged_in) { // check is the current session is logged in
        console.log(current.user.email); // will print the email of the currently logged in user
    } else {
        console.log("Could not authorize against Infoeducatie's API");
    }
})();

Check the typings for more info on the usage! The DOCs of the API are pretty much missing (except for the API.md) so i had to reverse it using the ruby code :) Hope you enjoy!

Want to contribute?

Here's how!

Readme

Keywords

none

Package Sidebar

Install

npm i infoeducatie-api-client

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

12.5 kB

Total Files

39

Last publish

Collaborators

  • iamthevex