2.2.1 • Published 3 years ago

zoib v2.2.1

Weekly downloads
36
License
-
Repository
-
Last release
3 years ago

Usage

const ZOIB = require("zoib");

const zoibUrl = 'https://zoib.digitalairways.com:443';
const zoibLogin = '<login>';
const zoibPassword = '<password>';

const zoib = new ZOIB(zoibUrl, zoibLogin, zoibPassword);

let tokens = [];

console.log(zoib.isLogged()); // false

zoib.login()
.then(_ => {
    console.log(zoib.isLogged()); // true
    return zoib.getTokens();
})
.then(data => {
    tokens = data;
    return true;
})
.then(_ => {
    // do what you want with your tokens
    // but when you are finished with them, push them back
    return zoib.pushTokens(tokens);
})
.catch(e) {
    console.error(e);
})
.finally(_ => {
    if(zoib.isLogged()){
        zoib.logout().then().catch()
    }
})
2.2.1

3 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.0

6 years ago