// you can pass the options in constructorconst putioAPI =newPutioAPI({ clientID:'OAUTH_CLIENT_ID'})// or use `configure` methodMyApp.bootstrap(config =>{
putioAPI.configure({ clientID: config.OAUTH_CLIENT_ID})})// setToken will send the given auth token with every request, in Authorization headerMyApp.onLogin(token =>{
putioAPI.setToken(token)
putioAPI.Account.Info().then(r =>console.log('Fetched user info: ', r)).catch(e =>console.log('An error occurred while fetching user info: ', e))})// clearToken will perform a clean-up and stop sending the token in Authorization headerMyApp.onLogout(()=>{
putioAPI.clearToken()})