1.2.5 • Published 6 years ago

cross-fetch-with-token v1.2.5

Weekly downloads
5
License
ISC
Repository
github
Last release
6 years ago

Install

npm install --save cross-fetch-with-token

Usage

With promises:

import fetch, { settings }  from 'cross-fetch-with-token';
settings.urlToken = 'https://yourdomain.com/api/connect/token/';
settings.clientData = {
    clientId: 'clientId',
    clientSecret: 'clientSecret',
    grantType: 'client_credentials'
};
fetch('url').then(res => {
    return res.json();
}).then(res => {
    console.log(res);
}).catch(err => {
    console.error(err);
});

Settings

OptionTypeDefault
urlTokenstring/
storeKeyTokenstringMY.APP.token
expiresTokennubmer86400ms (1 day)
clientDataobject{}

Author

@Stas Raranetskyi
Stas Raranetskyi
1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago