Reddit-inspired, dynamically generated GitHub Karma cards for your profile README!
Choose between two flavours - Creator Karma and Contributor Karma - to showcase both what you build and how you contribute across the GitHub community.
View Demo Β· Report Bug Β· Request Feature Β· Ask Question
Live Preview
Table of contents (Click to show)
Important
This project uses caching headers to reduce rate-limit pressure. Data is not real-time by design. Currently, the Karma cards are cached for 2 hours before regeneration.
Note
By default, data visibility depends on the permissions of your GitHub token. If you want private-repo-aware metrics, deploy your own instance with a properly scoped token.
The creator karma measures repository impact from stars and forks you have earned on your personal repositories, then maps the score to rank tiers.
Copy and paste this into your markdown, then replace username:
[](https://github.com/DAShaikh10/GitHub-Karma)Endpoint: /api/karma/creator?username=<GITHUB_USERNAME>&theme=<THEME_NAME>
| Name | Description | Type | Default value |
|---|---|---|---|
username |
GitHub username to evaluate. Must be 1-39 chars, alphanumeric or -, and cannot start/end with -. |
string | required |
theme |
Card theme name. Supports all built-in themes configured in this project. | enum | default |
The card returns image/svg+xml and can return error cards with HTTP status 400, 404, 429, or 500.
Use &theme=THEME_NAME:
This project includes a large set of built-in themes (including transparent) adapted from
@AnuragHazra's
GitHub-Readme-Stats. Theme definitions live in
src/lib/card/constants.ts.
Use the live URL format below to test any theme quickly:
http://github-karma.vercel.app/api/karma/creator?username=dashaikh10&theme=<THEME_NAME>
Click to expand full theme preview table
Use GitHub theme context tags for dark/light switching:
[](https://github.com/DAShaikh10/GitHub-Karma#github-creator-karma-card)
[](https://github.com/DAShaikh10/GitHub-Karma#github-creator-karma-card)The contributor card measures contribution activity (commits, pull requests, reviews, completed issues in other repos, and accepted discussion answers).
[](https://github.com/DAShaikh10/GitHub-Karma)Endpoint: /api/karma/contributor?username=<GITHUB_USERNAME>&theme=<THEME_NAME>
| Name | Description | Type | Default value |
|---|---|---|---|
username |
GitHub username to evaluate. Must be 1-39 chars, alphanumeric or -, and cannot start/end with -. |
string | required |
theme |
Card theme name. Supports all built-in themes configured in this project. | enum | default |
Copy and paste this into your profile README and replace YOUR_USERNAME:
<a href="https://github.com/DAShaikh10/GitHub-Karma">
<img align="center" src="http://github-karma.vercel.app/api/karma/creator?username=YOUR_USERNAME" />
</a>
<a href="https://github.com/DAShaikh10/GitHub-Karma">
<img align="center" src="http://github-karma.vercel.app/api/karma/contributor?username=YOUR_USERNAME" />
</a>Running your own instance avoids shared endpoint limits and gives you control over token scope and cache settings.
For self-hosting, create a GitHub token and set it as GITHUB_PERSONAL_ACCESS_TOKEN.
Classic token (simple setup):
- Go to
Settings -> Developer settings -> Personal access tokens -> Tokens (classic). - Create a token.
- Select scopes:
read:userrepo(required if you want private repository data)
Fine-grained token (more restrictive):
- Go to
Settings -> Developer settings -> Personal access tokens -> Fine-grained tokens. - Create a token for all repositories you want to include.
- Grant read-only access to relevant repository/user data.
After import:
- Set
GITHUB_PERSONAL_ACCESS_TOKENin Vercel environment variables. - Optionally tune cache and scoring variables.
- Redeploy after changing environment variables.
bun install
bun build
bun startSet GITHUB_PERSONAL_ACCESS_TOKEN in your runtime environment before starting.
Core runtime:
| Name | Default | Description |
|---|---|---|
GITHUB_PERSONAL_ACCESS_TOKEN |
none | GitHub token used for GraphQL requests. |
GITHUB_GRAPHQL_API_URL |
https://api.github.com/graphql |
GraphQL endpoint URL. |
CACHE_REVALIDATE_SECONDS |
3600 |
Next.js fetch revalidation for GitHub API responses. |
KARMA_CARD_CACHE_SECONDS |
7200 |
s-maxage value for card responses. |
STALE_WHILE_REVALIDATION_SECONDS |
300 |
stale-while-revalidate value for card responses. |
GITHUB_RATELIMIT_HEADER |
x-ratelimit-limit |
Header name used for total limit logging. |
GITHUB_RATELIMIT_REMAINING_HEADER |
x-ratelimit-remaining |
Header name used for remaining quota logging. |
GITHUB_RATELIMIT_RESET_HEADER |
x-ratelimit-reset |
Header name used for reset time logging. |
Creator scoring:
| Name | Default |
|---|---|
BEGINNER_STAR_THRESHOLD |
1 |
BEGINNER_STAR_MULTIPLIER |
1 |
FORK_ENGAGEMENT_MULTIPLIER |
1 |
STAR_PLATEAU_SCORE |
3200 |
STAR_SATURATION_SCALE |
3500 |
STAR_TAIL_SLOPE |
0.02 |
FORK_PLATEAU_SCORE |
900 |
FORK_SATURATION_SCALE |
1200 |
FORK_TAIL_SLOPE |
0.008 |
FORK_CURVE_WEIGHT |
0.6 |
HIGH_IMPACT_REPO_THRESHOLD |
1 |
HIGH_IMPACT_STARS |
1 |
HIGH_IMPACT_FORKS |
1 |
LEGEND_MULTIPLIER |
1 |
Contributor scoring:
| Name | Default |
|---|---|
COMMIT_WEIGHT |
1 |
CONTRIBUTOR_PR_WEIGHT |
1 |
CONTRIBUTOR_REVIEW_WEIGHT |
1 |
CONTRIBUTOR_ISSUE_WEIGHT |
1 |
CONTRIBUTOR_ANSWER_WEIGHT |
1 |
bun install
bun devOther useful commands:
bun lint
bun format
bun test
bun test:coverage
bun build
bun startIf GitHub Karma helps you, consider:
- Starring and sharing the repository.
- Opening issues and pull requests to improve the project.
Inspired by GitHub Readme Stats: https://github.com/anuraghazra/github-readme-stats
MIT