ebay-node-api icon indicating copy to clipboard operation
ebay-node-api copied to clipboard

getAccessToken() - a new access token with each request

Open EarthlingDavey opened this issue 5 years ago • 4 comments

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?

EarthlingDavey avatar Jun 17 '19 16:06 EarthlingDavey

@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 avatar Jun 21 '19 07:06 pajaydev

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

pajaydev avatar Jun 21 '19 07:06 pajaydev

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.

gnadelwartz avatar Jun 12 '21 16:06 gnadelwartz

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);
    });

emporioreale avatar Jul 10 '22 14:07 emporioreale