Skip to content

Commit

Permalink
feat(lib): add github wrapper
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Kristian Flaatten <hans.kristian.flaatten@dnt.no>
  • Loading branch information
Hans Kristian Flaatten committed Apr 22, 2016
1 parent 273d45e commit 50599f9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/github.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

const Client = require('github');

exports.client = function githubClient(user) {
const client = new Client({
version: '3.0.0',
debug: process.env.GITHUB_DEBUG === 'true',
});

client.authenticate({
type: 'oauth',
token: user.accessToken,
});

client._user = user;

return client;
};

0 comments on commit 50599f9

Please sign in to comment.