cryptotalkapi-token-mgmt
Version:
This package helps you to refresh the access token every 12 hours. You need access_token to access APIs provided by cryptotalk. All APIs are free to use. More information can be found here: https://cryptotalk.gitbook.io/
30 lines (19 loc) • 800 B
Markdown
Get your access token and refresh token from signing up for APIs at https://cryptotalk.finance
```bash
npm install -i cryptotalkapi-token-mgmt
```
```node
const _token_mgmt = require('cryptotalkapi-token-mgmt');
//You must get access and refresh token from cryptotalk API sign up
let access_token = "eyJraWQiOiJzZDV5TEk....3Mk8AuQ";
let refresh_token = "eyJjdHkiOiJKV1Q....4LTs3NBog";
//Start the refresh process - access_token is refreshed every 12 hours
_token_mgmt.startRefresh(access_token, refresh_token);
//This is how you can retrieve access token
console.log(_token_mgmt.getAccessToken());
```
[]( https://cryptotalk.gitbook.io/rest-apis/ )