Server-side SVG generator for displaying README cards containing GitHub's Traffic Insights. It uses the traffic data fetched by GitHits GitHub Action from the Insights/Traffic
section of your repository.
Head over to GitHits to setup a GitHub action to store traffic insights in your repository.
NOTE:
- This only works for public repositories
- This action generates a
hits.json
file in the master branch of your repository. - This file is required by GitHitServer for fetching Traffic Data
![<image-description>](https://githits.vercel.app/api/<route>?param_n=value_n&...)
- views
- clones
Name | Description |
---|---|
user | REQUIRED Your GitHub username |
repo | REQUIRED Your repository name |
mode | DEFAULT=light Can be light or dark . Applies GitHub's colour scheme |
theme | A pre-defined theme. Overrides mode parameter |
disable | Total or Unique . Hides the chosen statistic |
icon_color | COLOR for card's icon |
title_color | COLOR for card's title |
text_color | COLOR for card's body text |
bg_color | COLOR for card's background |
COLOR
accepts all URI Encoded CSS color values, including:
- RGB-Hex [
#fafafa
as%23fafafa
] - rgb/rgba [
rgb(4,6,8)
asrgb(4%2C6%2C8)
] - hsl/hsla [same as above]
- Color Keywords
- Run
npm i
oryarn
in the cloned directory - Install vercel cli globally using
npm i -g vercel
oryarn global add vercel
and login usingvercel login
(one-time setup only) - Run
vercel
to setup your project locally - Generate a Personal Access Token
(PAT)
from GitHub's developer settings - Run
vercel secrets add <secret-name> <PAT>
. This secret can be used in all of your Vercel projects. - Run
vercel env add secret <secret-name>
- Create a
.env
file and add<secret-name>=<PAT>
- Run
vercel dev
to start thelocalhost
server - Run
vercel
again to deploy
Replace <secret-name>
with any name of your choice and <PAT>
with the 40 character PAT (All without angular brackets)