pajaydev / ebay-node-api

eBay API Client for node
https://pajaydev.github.io/ebay-node-api
MIT License
131 stars 76 forks source link

getAccessToken() - a new access token with each request #38

Open EarthlingDavey opened 5 years ago

EarthlingDavey commented 5 years ago

Hi, should I be caching the access token and using it?

At the moment it looks like the module is requesting a new access token from ebay with every method call.

Is there an option to use a cached access token?

pajaydev commented 5 years ago

@daveybrown Hey, right now this library doesn't support caching. I recommend you to cache the access token. As I am planning to integerate with lru-cache as enhancement.

pajaydev commented 5 years ago

@daveybrown If you have any other idea, Let me know

gnadelwartz commented 3 years ago

in your examples it's shown how to get the token, but not to set a previously saved token when creating a new Ebay object, e.g. on next run.

emporioreale commented 2 years ago

I am getting this error on taxonomyapi: "Uncaught SyntaxError SyntaxError: Unexpected end of JSON input" This is the code:

ebay.getAccessToken().then((data) => {
        //console.log(data["access_token"]); // data.access_token
        ebay.getCategoryTree(0).then((data) => {
            console.log(data);
            // JSON format of complete category tree.  
        });
    }, (error) => {
        console.log(error);
    });