This project employs several authentication strategies to avoid rate limiting while using the GitHub Search API:
- Using each user's OAuth access token, if available -- this will allow you a maximum of 30 requests per-user / per-minute
- Falling back to a server-to-server token, associated with a given installation of your GitHub App -- this will allow you a maximum of 30 requests per-organization / per-minute
- Falling back again to simplified functionality, such as validating a given GitHub username, via GET /users/:username -- this will allow you a minimum of 5000 requests per-organization / per-hour
Step 1a: Prereqs via Glitch
- Remix this app :)
- Install
nodefrom the website or Homebrew git clonethe project- Navigate to the project directory and install dependencies using
npm i
- Create a new GitHub App.
- Homepage URL =
<Your Glitch App URL> - User authorization callback URL =
<Your Glitch App URL>/authorized - Webhook URL (unused) =
<Your Glitch App URL>/hooks - Download your private key at the bottom of the app settings page.
- Homepage URL =
- Make a new file in Glitch called
.data/pemand paste the contents of the private key. - Set the following variables in your Glitch
.envfile:GH_CLIENT_IDClient ID on app settings pageGH_CLIENT_SECRETClient secret on app settings pageGH_APP_IDApp ID on app settings pageINSTALLATION_IDInstallation ID, which you can retrieve from here
- Navigate to your URL for live-reloaded goodness
npm start
- This app is single-user (for now). It stores the OAuth token in a file found at
.data/oauth.