UNPKG

439 BJavaScriptView Raw
1const ghauth = require('./')
2const authOptions = {
3 // provide a clientId from a Github oAuth application registration
4 clientId: '123456',
5
6 // ~/.config/awesome.json will store the token
7 configName: 'awesome',
8
9 // (optional) whatever GitHub auth scopes you require
10 scopes: ['user'],
11
12 // (optional)
13 userAgent: 'My Awesome App'
14}
15
16ghauth(authOptions, function (err, authData) {
17 if (err) throw err
18 console.log(authData)
19})