constZOIB=require("zoib");constzoibUrl='https://zoib.digitalairways.com:443';constzoibLogin='<login>';constzoibPassword='<password>';constzoib=newZOIB(zoibUrl,zoibLogin,zoibPassword);lettokens=[];console.log(zoib.isLogged());// falsezoib.login().then(_=>{console.log(zoib.isLogged());// truereturnzoib.getTokens();}).then(data=>{tokens=data;returntrue;}).then(_=>{// do what you want with your tokens// but when you are finished with them, push them backreturnzoib.pushTokens(tokens);}).catch(e){console.error(e);}).finally(_=>{if(zoib.isLogged()){zoib.logout().then().catch()}})