github-tools / github

A higher-level wrapper around the Github API. Intended for the browser.
BSD 3-Clause "New" or "Revised" License
3.56k stars 754 forks source link

initialize user with access token #674

Open john012343210 opened 2 years ago

john012343210 commented 2 years ago
import GitHub from 'github-api';

// basic auth
const gh = new GitHub({
   username: 'FOO',
   password: 'NotFoo'
});

how to initialize the user with an access token instead?

kymtwyf commented 2 years ago
// token auth
const gh = new GitHub({
   username: 'FOO',
   token: 'YourToken'
});