github-integration

NodeJS module for building GitHub Integrations

The github-integration package has been replaced by the github-app package
Last updated 9 years ago by bkeepers .
ISC · Original npm · Tarball · package.json
$ cnpm install github-integration 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.1                                ...           latest (9 years ago)

3 Versions

  • 2.0.1 [deprecated]           ...           9 years ago
  • 2.0.0 [deprecated]           ...           9 years ago
  • 1.0.0 [deprecated]           ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |