GithubHelp home page GithubHelp logo

github-app's Introduction

DEPRECATED

Replaced by @octokit/auth-app

GitHub Apps

NodeJS module for building GitHub Apps.

Installation

npm install --save github-app

Usage

const createApp = require('github-app');

const app = createApp({
  // Your app id
  id: 987,
  // The private key for your app, which can be downloaded from the
  // app's settings: https://github.com/settings/apps
  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 Apps:

//Modify value according to getInstallations return(example in asApp section)
var installationId = 99999;

app.asInstallation(installationId).then(github => {
  github.issues.createComment({
    owner: 'foo',
    repo: 'bar',
    number: 999,
    body: 'hello world!'
  });
});

asApp

Authenticate as an app, also returning an instance of the GitHub API client.

app.asApp().then(github => {
  console.log("Installations:")
  github.apps.getInstallations({}).then(console.log);
});

github-app's People

Contributors

bkeepers avatar cirpo avatar gr2m avatar greenkeeper[bot] avatar hiimbex avatar jbjonesjr avatar jkukul avatar sadpandabear avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

github-app's Issues

Bump to latest octokit?

Newest octokit is on 16.x, this repo is still on 15.x

Should be a quick bump in the package.json

Support configuration for GitHub baseUrl

Hi,

I tried to use Probot as a foundation for a GitHub App, which is going to be installed in our self hosted GitHub Enterprise instance.
As GitHub App and GitHub Enterprise are on the same local network, I found it weird, that Probot forces me to use Smee (and it was complicated to setup behind a corporate firewall, etc.).

So I decided to use github-app and github-webhook-handler, as described here.
But I couldn't make github-app work with a custom GitHub url.

Currently I am using a modified copy of the github-app, which adds the 'baseUrl' parameter to the constructor of @octokit/rest.

Maybe you could officially make the GitHub url configurable and pass it through to the @octokit/rest?!

Best regards
Stefan

Avoid explicit dependency on `github`

Per discussion in #8 (comment), it'd be nice to figure out how to avoid a direct dependency on node-github, which means a new version of this has to be released every time node-github is updated. ๐Ÿ˜ข

A proposed solution is to use peerDependencies, and then inject an instance of the GitHub client into the constructor.

const GitHubApi = require('github');
const createApp = require('github-app');
const app = createApp({id: 987, cert: ..., github: GitHubApi)

Long term, I think the functionality of this plugin should just be folded into the GitHub client.

cc @gr2m @jeffwilcox

Typescript type definitions

Please provide type definitions
they are missing from github-app package and not available as @types/github-app standalone page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.