Goal
This package is made to simplify calls to the GitHub API as a GitHub App. It authenticates as a GitHub App and then gives you a wrapper around Fetch so that you can interact with the GitHub API easily.
Usage
- Add this package to your dependencies:
npm install --save fetch-github-app
- Use it like this:
const fetchGithubApp = ; const config = // Can be found in the "GitHub Apps" section of your developer or organization settings. appId: 1337 // See https://developer.github.com/apps/building-integrations/setting-up-and-registering-github-apps/registering-github-apps/#generating-a-private-key. appPrivateKey: '-----BEGIN RSA PRIVATE KEY----- ...' // Can be found in the "Installed GitHub Apps" section of your developer or organization settings, // or in the payload of WebHook requests sent by GitHub to your App. installationId: 42 // See https://developer.github.com/v3/#user-agent-required. userAgent: 'your-username-or-org-name' ; ;
Testing
To test the package on your machine:
npm install
- Create a
.env
file respecting the dotenv guidelines and add the environment variables mentioned byindex.test.js
. npm test