github-stats

Dynamic SVG stats widgets for GitHub profiles — built on Cloudflare Workers + KV

Endpoints

/langs
Top 10 languages by bytes — segmented bar + legend
/langs widget
/stats
Commits, PRs, stars, issues, forks — stat grid
/stats widget
/streak
Current streak, longest streak, total contributions
/streak widget
/repos
Top 6 repos by stars — 2-column cards
/repos widget
/contrib
Full-year contribution heatmap (GitHub-style calendar)
/contrib widget
/trophies
Achievement trophies — C to SSS tier based on stats
/trophies widget
/profile
Animated profile card — stats + orbital space animation
/profile widget
/stack
Tech stack chips — pass ?techs=Laravel,Vue,TypeScript
/stack widget
/icon?name=bolt&color=0d87cd&size=48
Single-color SVG icon — ?name=bolt&color=0d87cd&size=20 (no background)
/icon widget

Usage

Embed any widget directly in a GitHub README:

![langs](https://github.spoko.space/langs)
![stats](https://github.spoko.space/stats)
![streak](https://github.spoko.space/streak)
![repos](https://github.spoko.space/repos)
![contrib](https://github.spoko.space/contrib)
![trophies](https://github.spoko.space/trophies)
![stack](https://github.spoko.space/stack?techs=Laravel,Vue,TypeScript,Astro)

Stack endpoint

https://github.spoko.space/stack?techs=Laravel,Vue,TypeScript,Tailwind,PHP,Node.js,WordPress

Icon endpoint

UI Icons — Bare single-color SVG icons for use inline in Markdown. Sourced from Phosphor Icons (thin weight):

<img height="14" src="https://github.spoko.space/icon?name=building&color=0d87cd" align="absmiddle" /> Running SPOKO SPACE
<img height="14" src="https://github.spoko.space/icon?name=bolt&color=0d87cd" align="absmiddle" /> 15+ years experience
<img height="14" src="https://github.spoko.space/icon?name=map-pin&color=0d87cd" align="absmiddle" /> Bielsko-Biała

Tech Stack Icons — 50+ tech icons with official brand colors. Use in /icon?name=<tech>&color=... or via /stack?techs=<tech1>,<tech2>,...

Tech icons sourced from simple-icons and @iconify-icons/logos with official brand colors.

Circle variant

Add circle=1 to render the icon inside a circular badge — icon is scaled down to 75% and placed on a semi-transparent background of the same color. Control background opacity with opacity (0–1, default 0.2). Useful for profile READMEs and feature grids:

<img height="40" src="https://github.spoko.space/icon?name=rocket&color=0d87cd&size=40&circle=1" />
<img height="40" src="https://github.spoko.space/icon?name=star&color=5fe06a&size=40&circle=1&opacity=0.15" />
<img height="40" src="https://github.spoko.space/icon?name=heart&color=e05f7a&size=40&circle=1&opacity=0.35" />
bolt rocket star heart code globe trophy sparkles

Theme Params

All endpoints accept these URL query params. Hex values without the # prefix.

Param Type Default Description
?theme str dark Base palette — light or dark (default). Applies full light/dark preset; all other params override on top.
?bg hex 030620 Main background color
?card hex 060d24 Card/chip background
?bar hex 0d1a2e Progress bar background
?border hex 0d2a4a Border color
?primary hex 0d87cd Accent / highlight color
?text hex e5ecf6 Primary text color
?muted hex 7a9cc0 Secondary text color
?dim hex 4a6a8a Tertiary / dim text color
?radius px 10 Corner radius in pixels
?font str ui-sans-serif,system-ui,sans-serif Font family

Examples

https://github.spoko.space/langs?theme=light
https://github.spoko.space/langs?bg=0d1117&primary=58a6ff&text=c9d1d9&radius=6

Fork & Deploy

1

Fork the repo and clone it locally

git clone https://github.com/your-username/github-stats
cd github-stats
npm install
2

Create a GitHub personal access token with read:user and repo scopes, then add it as a Wrangler secret

npx wrangler secret put GITHUB_TOKEN
3

Add a token for the cache-bust endpoint

npx wrangler secret put CACHE_BUST_TOKEN
4

Update OWNERS in src/index.ts with your GitHub username(s), then deploy

npx wrangler deploy