Skip to content

Repository files navigation

GH-Stats

Open-source GitHub profile stats — one unified, first-party SVG widget for your README.

Third-party widget hosts often fail to render. GH-Stats serves the image from your deployment so embeds stay reliable. Users never paste a GitHub token; private contributions only appear when someone has already enabled them on their public GitHub profile.

Features

  • Unified widget: overview, streak, top languages (bars / pie / donut), activity graph
  • Combined all-in-one embed or solo blocks for each module
  • Choose how many top languages to show (3 / 5 / 8 / 10 / all); remainder folds into Others
  • Builder UI: modules, per-module colors, theme presets (including Transparent), border toggle
  • Copy Markdown or HTML embed code, plus a share link that reopens the same setup (/?username=…&modules=…)
  • Self-hosted /api/stats SVG endpoint
  • No end-user OAuth or PATs

Quick start

npm install
npm run dev

Open http://localhost:3000, enter a username, customize, copy the embed.

Optional env

cp .env.example .env.local
# GITHUB_TOKEN=ghp_...              # deployer token for higher API limits
# NEXT_PUBLIC_GITHUB_REPO=https://github.com/you/GH-Stats

Embed

After deploying, use the builder export, or:

![username's GitHub stats](https://YOUR_DOMAIN/api/stats?username=YOUR_USER&modules=all&langs=donut&bg=0D1117&text=E6EDF3&border=30363D&surface=161B22&muted=8B949E&c_overview=58A6FF&c_streak=F78166&c_languages=3FB950&c_activity=58A6FF)

Query params

Param Description
username GitHub login
modules all or comma list: overview,streak,languages,activity (single module = solo widget)
langs bars, pie, or donut (when languages module is on)
top Language count: 3, 5 (default), 8, 10, or all
show_border 1 (default) or 0 to hide card/panel borders
bg text muted border surface Canvas colors (hex without #, or transparent)
c_overview c_streak c_languages c_activity Per-module accent colors
accent Legacy alias for c_overview

Privacy

GH-Stats reads:

  1. Public GitHub REST data (profile, repos, languages)
  2. The public contributions calendar HTML (/users/{user}/contributions)

If a user enables Include private contributions on my profile, those counts are already public on that calendar. We never request or store visitor credentials.

Language percentages are repo-weighted. For every owned non-fork repo, GitHub's /languages byte breakdown is converted to per-repo fractions (summing to 1), then those fractions are summed across repos and divided by the repo count. A language used in many repos ranks high; one huge codebase can't dominate on raw bytes.

Stack

Next.js (App Router) · Tailwind CSS · ArchiveStamp + Space Grotesk · first-party SVG

License

MIT

About

GH-Stats reads public GitHub data and renders one self-contained SVG: overview numbers, streak, top languages, and a year of activity. Because the image is served from this deployment instead of a shared widget farm, it keeps rendering.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages