Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
EarthlingDavey opened this issue Jun 17, 2019 · 4 comments
Open

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

EarthlingDavey opened this issue Jun 17, 2019 · 4 comments

Comments

@EarthlingDavey
Copy link
Contributor

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
Copy link
Owner

@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
Copy link
Owner

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

@gnadelwartz
Copy link

gnadelwartz commented Jun 12, 2021

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
Copy link

emporioreale commented Jul 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants