Prerequisites
Before you begin, make sure you have:Node.js
Version 18 or higher
pnpm
Version 8 or higher (specified in package.json)
GitHub account
For contribution data and hosting your profile
Cloudflare account
Free tier works perfectly for this project
You’ll also need a GitHub personal access token with
read:user scope to fetch contribution data.Installation
Install dependencies
The project uses pnpm as specified in Install the packages:
package.json:package.json
Create environment variables file
Create a
.env file in the project root with your credentials:.env
Creating a GitHub token
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click Generate new token (classic)
- Give it a descriptive name like “Profile README Stats”
- Select the
read:userscope - Click Generate token and copy it to your
.envfile
Update the worker configuration
Edit Change
wrangler.toml to customize your worker name:wrangler.toml
name to something unique for your Cloudflare Workers subdomain.Local development
Test your worker locally before deploying:http://localhost:8787/?section=top&theme=light- Top header barhttp://localhost:8787/?section=main&theme=dark- Main contribution graphhttp://localhost:8787/?section=link-website&theme=light&i=0- Social link example
Deploy to Cloudflare
Authenticate with Cloudflare
Log in to your Cloudflare account via Wrangler:This opens a browser window for authentication.
Deploy the worker
Deploy your worker to Cloudflare’s edge network:The
deploy script runs pnpm stats first to ensure you have fresh data, then deploys with Wrangler.You’ll receive a URL like:Add to your GitHub profile
Now that your worker is live, add it to your GitHub profile README:Create or edit your profile README
If you don’t have a profile README yet:
- Create a repository with the same name as your GitHub username
- Add a
README.mdfile - The README will automatically display on your profile
GitHub has a guide on managing your profile README.
Add the SVG images
Use the
<picture> element with theme-specific sources:README.md
The empty
<img src="data:null;,"> elements create spacing between sections. Adjust height values as needed.Customize link sections
Available link sections in the source code:You can add custom sections by modifying
link-resume- Resume/CV linklink-website- Personal websitelink-linkedin- LinkedIn profilelink-twitter- Twitter/X profilelink-facebook- Facebook profilelink-instagram- Instagram profile
i parameter for animation stagger timing:src/worker.ts
src/worker.ts.Set up automatic updates
Keep your stats fresh with GitHub Actions:Add repository secrets
In your GitHub repository:
- Go to Settings > Secrets and variables > Actions
- Add these secrets:
GH_SECRET: Your GitHub personal access tokenCLOUDFLARE_API_TOKEN: From Cloudflare dashboardCLOUDFLARE_ACCOUNT_ID: From your Cloudflare Workers dashboard
Verification
Confirm everything is working:Worker is responding
Worker is responding
200 OK with content-type: image/svg+xmlThemes are working
Themes are working
Visit the same URL with
theme=light and theme=dark - colors should change appropriately.Data is recent
Data is recent
Check that your contribution graph shows recent activity. If not, run
pnpm stats again.GitHub Actions is running
GitHub Actions is running
Check the Actions tab in your repository to ensure the workflow runs successfully.
Troubleshooting
GraphQL API errors
GraphQL API errors
Error:
Failed to fetch contributionsSolution: Check that:- Your
GH_SECRETis valid and has theread:userscope - The username in
scripts/stats.tsmatches your GitHub username - Your token hasn’t expired
Wrangler authentication fails
Wrangler authentication fails
Error:
Not logged inSolution: Run pnpm wrangler login and authenticate in the browser that opens.SVG doesn't render on GitHub
SVG doesn't render on GitHub
Error: Image shows as brokenSolution:
- Ensure your worker URL is publicly accessible
- Check that the
content-typeheader isimage/svg+xml - Verify there are no CORS issues (shouldn’t be any for SVG)
Animations don't work in Firefox
Animations don't work in Firefox
Known issue: Firefox doesn’t support CSS animations in SVG
foreignObject elements.Solution: The project includes a fallback section specifically for Firefox users:Next steps
Now that your profile is live, explore these guides:Customize themes
Change colors, fonts, and animations
Add custom sections
Create new SVG sections for your profile
API reference
Explore all available sections and parameters
Architecture
Understand how the system works in depth