{"id":13895273,"url":"https://github.com/gr2m/octokit-app-example","last_synced_at":"2026-03-25T10:30:35.342Z","repository":{"id":56458233,"uuid":"306104667","full_name":"gr2m/octokit-app-example","owner":"gr2m","description":"An example GitHub app implemented using Octokit libraries","archived":false,"fork":false,"pushed_at":"2021-03-05T06:48:11.000Z","size":46,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-22T13:23:28.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gr2m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-21T17:49:34.000Z","updated_at":"2024-03-21T18:28:33.000Z","dependencies_parsed_at":"2022-08-15T19:10:25.530Z","dependency_job_id":null,"html_url":"https://github.com/gr2m/octokit-app-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Foctokit-app-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Foctokit-app-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Foctokit-app-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Foctokit-app-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gr2m","download_url":"https://codeload.github.com/gr2m/octokit-app-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238735908,"owners_count":19521910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T18:02:06.154Z","updated_at":"2026-03-25T10:30:35.259Z","avatar_url":"https://github.com/gr2m.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# octokit-app-example\n\nAn example GitHub app implemented using `@octokit/*` libraries.\n\nThe app does 3 common things.\n\n1. Sends a request authenticated as the app itself (JWT). In this case, it retrieves information about itself.\n2. Iterates through all installations, authenticates as each installation, then iterates through all repositories. In this example, it creates a [`repository_dispatch` event](https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-a-repository-dispatch-event).\n3. It acts on webhook events. The example simulates the retrieval of an `issues.opened` event for [gr2m/sandbox#143](https://github.com/gr2m/sandbox/issues/143). It authenticates as the according installation and creates a comment on the issue.\n\nI use this example as a base of discussion on how to simplify the existing APIs.\n\n## Changes\n\n1. [initial version of the code](https://github.com/gr2m/octokit-app-example/blob/19e35f944c058c88618fda0e53fbed41be115b32/index.js)\n2. Derive installation octokit from app octokit: [changes](https://github.com/gr2m/octokit-app-example/pull/2/files) (-20 LOC)\n3. Use [`@octokit/app`](https://github.com/octokit/app.js/): [changes](https://github.com/gr2m/octokit-app-example/pull/3/files) (-50 LOC)\n\n## Local setup\n\nIn order to test the code, you will have to [register a new GitHub app](https://github.com/organizations/octokit/settings/apps/new). The app requires read \u0026 write access for\n\n1. content\n2. issues\n\nYou can disable webhooks.\n\nThen copy `.env.example` to `.env` and set the values to the credentials of your GitHub app registration.\n\nThen install the app on a test repository. In that repository, create a new issue. Update the `webhooks.receive()` in the example with the repository owner, name and the issue number of your example issue.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Foctokit-app-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgr2m%2Foctokit-app-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Foctokit-app-example/lists"}