This package has been deprecated

Author message:

The github-integration package has been replaced by the github-app package

github-integration

2.0.1 • Public • Published

GitHub 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);
});

Readme

Keywords

none

Package Sidebar

Install

npm i github-integration

Weekly Downloads

0

Version

2.0.1

License

ISC

Last publish

Collaborators

  • bkeepers