SSR-Contribution-Svg
A Nest.js API to render GitHub user's contributions to chart
Just pass Github username in route params, you will get the contribution wall render by svg. Support custom output format, color, quantity, size and so on
online exampleUsage
-
prepare your github pat for Github OpenAPI:
-
create a
.envfile in the root of project, Fill it with reference.env.example -
install packages with:
# npm install yarn install -
run server:
# npm run start:dev yarn start:dev -
try it out visit
http://localhost:${port}/_/${username},port:SERVE_PORTvariable in your.env, default is3000username: Github username
Configuration
| param | type | desc | default |
|---|---|---|---|
| theme | enum |
Preset themes, avaiable values:
|
green |
| chart | enum |
Chart type, only calendar supported yet
|
calendar |
| format | enum |
Output formats:
|
html |
| quality | number |
Image quality, supports numbers from 0.1 to 10.
Only works when format is
png or jpeg
|
1 |
| widget_size | enum |
Automatically calculate the number of weeks and size needed for the ios widget by specifying this property, avaiable values:
|
midium |
| weeks | number |
Force specifying how many weeks to render, allow numbers from
1 to 50.
This will override weeks calculated by widget_size
|
undefined |
| colors | string |
Hex colors value join with
,.
This will override
theme property
|
undefined |
Example
-
Use as ios widget with Scritable, example code:
let url = "https://ssr-contributions-svg.vercel.app/_/CatsJuice?format=png&quality=2&theme=red&widget_size=midium" let w = await createWidget(); Script.setWidget(w); async function createWidget() { let w = new ListWidget(); let random = (Math.random()*100000000).toFixed(0); let data = await new Request(url + "&random=" + random).load(); let image = Image.fromData(data); w.backgroundImage = image; return w; }
Add scritable widget to home screen, and select script in widget configuration.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.


