https://github.com/sammyrobensparadise/github-contributions-counter
A simple Javascript API that will return the public github contributions history for a user based on a universal function
https://github.com/sammyrobensparadise/github-contributions-counter
api contribution-history contributions counter dependencies github github-contributions githubcontributions javascript javascript-api npm proxy rest-api stable
Last synced: 11 days ago
JSON representation
A simple Javascript API that will return the public github contributions history for a user based on a universal function
- Host: GitHub
- URL: https://github.com/sammyrobensparadise/github-contributions-counter
- Owner: SammyRobensParadise
- License: mit
- Created: 2020-04-23T22:56:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T21:25:23.000Z (over 3 years ago)
- Last Synced: 2025-10-05T11:24:43.452Z (7 months ago)
- Topics: api, contribution-history, contributions, counter, dependencies, github, github-contributions, githubcontributions, javascript, javascript-api, npm, proxy, rest-api, stable
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/github-contributions-counter
- Size: 13.1 MB
- Stars: 17
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# github-contributions-counter
A simple Javascript API that will return the public Github contributions history for a user based on a universal function


## A Quick Note 👀
This is a simple REST API wrapper around GitHubs API/V4 contributions graphQL api. Prior to the implementation of the V4 api this package scraped contribution data from GitHub profiles.
## Getting Started
### Install
Via `npm`
```bash
npm i github-contributions-counter
```
Via `yarn`
```bash
yarn add github-contributions-counter
```
### Demo
[Demo](https://sammy.world/github-stats)
## Usage
```jsx
import { getGithubContributions } from 'github-contributions-counter'
getGithubContributions({
username: 'github_username',
token: 'github_token' // secret
}).then((r) => {
console.log(r)
})
```
## API
### Interface
| Parameter | Description | Status | Type |
| --- | --- | --- | --- |
| `username` | A valid GitHub username. Organization names are not currently supported | Required | string |
| `token` | A valid GitHub PAT with `read:usr` permissions. You can find instructions on how to generate a PAT [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). | Required | string |
## Issue Tracker
[Issues](https://github.com/SammyRobensParadise/github-contributions-counter/issues)
## Contributing
Contributions are welcomed and encouraged! Refer to [Contribution Guidelines](docs/CONTRIBUTING.md)
## Development
1. Clone
```bash
git clone git@github.com:SammyRobensParadise/github-contributions-counter.git
```
2. Install
```bash
npm install
# or
yarn install
```
3. Develop 💻
4. Build using `rollup.js`
```bash
npm run build
# or
yarn run build
```
## Info
Author: Sammy Robens-Paradise. [sammy.world](https://sammy.world)