github icon indicating copy to clipboard operation
github copied to clipboard

Working with github enterprise

Open ipsquare opened this issue 7 years ago • 2 comments

Is there a way to use this lib with Git-Hub Enterprise?

I tried this as below but it doesn't seem to work. Please let me know what I'm missing.

const token = process.env.GIT_API_TOKEN,
    apiBase = 'https://git.company.com/api/v3',
    GitHub = require('github-api'),
    gh = new GitHub({ token, apiBase });

let me = gh.getUser();
me.listNotifications(function(err, notifications) {
        console.log(notifications);
});

ipsquare avatar Jan 25 '19 22:01 ipsquare

Did you figure out the issue? I've used it with GHE in the past just fine.

What error are you getting from this snippet?

clayreimann avatar Mar 31 '19 23:03 clayreimann

Yes it works. @ipsquare You need to fill in the token as an object and apiBase as a string: gh = new GitHub({ "token":"1234qwerty" }, "url-to-the-enterprise-api" );

joelml avatar Mar 27 '20 12:03 joelml