The GitHub API limits unauthenticated requests to 60 per hour per IP. On hosted platforms like Vercel, this limit is quickly exceeded, causing the contributors list to fail loading.
By adding authentication, you can increase the rate limit to 5000 requests per hour.
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click "Generate new token (classic)"
- Give it a descriptive name: "AnimateHub Contributors API"
- Set expiration as needed (recommend 1 year)
- Select scopes: Only check
public_repo(for reading public repository data) - Click "Generate token"
- IMPORTANT: Copy the token immediately (you won't see it again)
For Local Development:
- Create
.envfile in your project root:
VITE_GITHUB_TOKEN=ghp_your_token_hereFor Vercel Deployment:
- Go to your Vercel project dashboard
- Navigate to Settings > Environment Variables
- Add new variable:
- Name:
VITE_GITHUB_TOKEN - Value:
ghp_your_token_here - Environment: Production, Preview, Development
- Name:
- Redeploy your application
The Contributors.jsx component automatically uses the environment variable. No code changes needed after setting up the token!
// This is already implemented in the code:
const GITHUB_TOKEN = import.meta.env.VITE_GITHUB_TOKEN;
if (GITHUB_TOKEN) {
headers['Authorization'] = `token ${GITHUB_TOKEN}`;
}- Never commit tokens to your repository
- Use environment variables for all deployments
- The token only needs
public_reposcope for reading public data - Consider token rotation every 6-12 months
- Without token: 60 requests/hour
- With token: 5000 requests/hour
- Current app usage: ~1-2 requests per user session
This setup will ensure your contributors page works reliably on both local development and production!