github icon indicating copy to clipboard operation
github copied to clipboard

listStarredRepos not really doing anything

Open charbelsako opened this issue 6 years ago • 1 comments

first, can this be run on a website with native js?

Second, is the listStarredRepo function bugged. I tried running it with callbacks, with the .then. used my password and then used an access token.

What i want to achieve

I want a page that lists all of my repos. That's it. I don't really need to authenticate myself since the repo data is public.

charbelsako avatar Jun 27 '18 21:06 charbelsako

It should be able to work in a browser, but keep in mind risks associated with having your GitHub credentials exposed in a client app.

GitHub throttles unauthenticated API access, so I think you would probably still want to auth. Maybe try something like this:

const github = new Github({
    username: 'myuser',
    password: 'mypassword',
    auth: 'basic',
});
let user = github.getUser();
user.listStarredRepos().then(result => {
    console.log(result)
});

This may not be exact, but something like this should work.

j-rewerts avatar Apr 10 '19 06:04 j-rewerts