github-integration
v2.0.1GitHub Integration
NodeJS module for building GitHub Integrations.
Installation
npm install --save github-integration
Usage
const createIntegration = require('github-integration');
const integration = createIntegration({
// Your integration id
id: 987,
// The private key for your integration, which can be downloaded from the
// integration's settings: https://github.com/settings/integrations
cert: require('fs').readFileSync('private-key.pem')
});
asInstallation
Authenticate as an installation, returning a github API client, which can be used to call any of the APIs supported by GitHub Integrations:
var installationId = 99999;
integration.asInstallation(installationId).then(github => {
github.issues.createComment({
owner: 'foo',
repo: 'bar',
number: 999,
body: 'hello world!'
});
});
asIntegration
Authenticate as an integration, also returning an instance of the GitHub API client.
integration.asIntegration().then(github => {
console.log("Installations:")
github.integrations.getInstallations({}).then(console.log);
});
npm i github-integration
Metadata
- ISC
- Whatever
- Brandon Keepers
- released 6/4/2017