{"id":19135395,"url":"https://github.com/keen/github-analytics","last_synced_at":"2025-05-06T19:29:32.454Z","repository":{"id":146827096,"uuid":"106483351","full_name":"keen/github-analytics","owner":"keen","description":"GitHub Analytics with Keen IO","archived":false,"fork":false,"pushed_at":"2020-04-14T17:13:04.000Z","size":110,"stargazers_count":47,"open_issues_count":1,"forks_count":7,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-19T13:47:00.717Z","etag":null,"topics":["analytics","developer-tools","github-events","github-webhooks","workflow-management"],"latest_commit_sha":null,"homepage":"https://blog.keen.io/tracking-github-data-with-keen-io-f130bcdec545","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/keen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-10T23:47:18.000Z","updated_at":"2025-01-26T17:21:52.000Z","dependencies_parsed_at":"2023-07-09T09:16:30.757Z","dependency_job_id":null,"html_url":"https://github.com/keen/github-analytics","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/keen%2Fgithub-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keen%2Fgithub-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keen%2Fgithub-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keen%2Fgithub-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keen","download_url":"https://codeload.github.com/keen/github-analytics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252752800,"owners_count":21798855,"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":["analytics","developer-tools","github-events","github-webhooks","workflow-management"],"created_at":"2024-11-09T06:30:06.408Z","updated_at":"2025-05-06T19:29:32.446Z","avatar_url":"https://github.com/keen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Analytics with Keen IO\n\nStream event data from your GitHub repos to a Keen project via GitHub's event stream webhooks. \n\n[Read more about this project here](https://blog.keen.io/tracking-github-data-with-keen-io-f130bcdec545).\n\n\n### Installation\n\nClone and install this project. NodeJS v6.11 or higher is required.\n\n```ssh\n# Clone this repo\ngit clone https://github.com/keen/github-analytics.git\ncd github-analytics\n\n# Copy optional env file\ncp .env-sample .env\n\n# Install dependencies\nnpm install\n```\n\n\n### Project ID \u0026 API Key\n\n[Login to Keen IO to create a project](https://keen.io/login?s=gh_github-analytics) and grab the **Project ID** and **Write Key** from your project's **Access** page. \n\n![image of Access page](access_page.png)\n\n**If you are new to Keen IO** and have not sent your first event yet, you can find your **Project ID** and **Write Key** in the at the bottom of the cURL section of the onboarding docs:\n\n![image of cURL section](curl_section.png)\n\nCopy these into the `KEEN_PROJECT_ID` and `KEEN_WRITE_KEY` fields of the `.env` file created previously, or set these environmental variables manually:\n\n```ssh\nexport KEEN_PROJECT_ID=YOUR_PROJECT_ID\nexport KEEN_WRITE_KEY=YOUR_WRITE_KEY\n```\n\n\n### GitHub Access Token\n\n[Create a new GitHub access token](https://github.com/settings/tokens/new) with the `admin:org_hook` option selected. Copy this into the `GITHUB_ACCESS_TOKEN` field of the `.env` file created previously, or set this environmental variable manually:\n\n```ssh\nexport GITHUB_ACCESS_TOKEN=YOUR_ACCESS_TOKEN\n```\n\nNext, add the name of the organization you want to configure to the `GITHUB_ORG` field:\n\n```ssh\nexport GITHUB_ORG=your-org-name\n```\n\n**Important: you must be an admin** for all of the GitHub organizations listed for your access token to work properly.\n\nIf you wish to instrument more than one org, this field can contain a comma-separated list of names without spaces:\n\n```ssh\nexport GITHUB_ORG=your-org-name,second-org\n```\n\nThe script will create all of the necessary webhooks for each organization listed. All event data will be recorded to the same Keen project from the previous step, but can be segmented or filtered by an `organization.login` property, which exists for all event types.\n\n\n### Run the Script\n\nFinally, run the following command to execute the script:\n\n```ssh\nnpm start\n```\n\nThe script will log the creation status for each webhook.\n\nOnce the script completes, visit [https://github.com/organizations/`GITHUB_ORG`/settings/hooks](https://github.com/organizations/`GITHUB_ORG`/settings/hooks) for each organization to confirm all 33 webhooks were created successfully. Your Keen project should now contain a few initial events for each webhook as well.\n\n**If you are new to Keen IO** and have not sent your first event yet, you can click the \"Check for Data\" button in the cURL section to confirm your GitHub webhooks have streamed to Keen. **Reminder:** Some event will need to happen within your GitHub organization to trigger a webhook.\n\n### Example Charts\n\nData will begin streaming into your Keen project as new git activity is recorded. Now you can use Keen IO’s visualization tools like the Explorer, Dashboards, and Compute API to dig into granular workflow metrics.\n\n![image](https://user-images.githubusercontent.com/180438/31462249-f94b85ae-ae80-11e7-9ed5-90d173fece75.png)\n\n![image](https://user-images.githubusercontent.com/180438/31462252-fd328b4a-ae80-11e7-82d9-f08b944a94a6.png)\n\n![image](https://user-images.githubusercontent.com/180438/31462259-01247ff6-ae81-11e7-9d42-d11962e799b0.png)\n\n\n### Show and Tell!\n\nWe’d love to hear from you! What metrics and charts would you like to see in a dashboard? What are challenges you have had with working with GitHub data? We’ve talked to a lot of open source maintainers, but we want to hear more from you.\n\nFeel free to open an issue or send an email to [opensource@keen.io](mailto:opensource@keen.io). Also, if you build anything with your GitHub data, we’d love to see it! ❤️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeen%2Fgithub-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeen%2Fgithub-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeen%2Fgithub-analytics/lists"}