tokenhelper

1.1.13 • Public • Published

Token helper

manage subiz access token and refresh token for clients

Install

npm i --save tokenhelper

Usage

example

Standalone

const th = require('tokenhelper')
let token = th.createHelper({tokenep: "https://subiz.com/oauth/"})
 
// user login => got tokens
token.reset({account_id, agent_id, access_token, refreshtoken, expires_in})
 
// use the token
 
var tk = await token.get()
if (tk.error) {
    throw tk.error
}
 
// ...
apireq.setQuery({access_token: tk.access_token}).send()
// ...
 
 

Readme

Keywords

none

Package Sidebar

Install

npm i tokenhelper

Weekly Downloads

1

Version

1.1.13

License

MIT

Unpacked Size

3.69 kB

Total Files

4

Last publish

Collaborators

  • tranducck
  • thanhpk