Skip to content

Deploy on Vercel

Rangga Fajar Oktariansyah edited this page Mar 31, 2026 · 1 revision

Host Your Own Instance

You can host your own instance of the GitHub Readme Profile API on Vercel. This gives you full control over the endpoint and allows you to customize behavior or add new features.

Prerequisites

  • GitHub account
  • Vercel account (you can log in with GitHub)
  • GitHub Personal Access Token with repo and user scopes

Step-by-Step Deployment

1. Fork the Repository

Fork the github-readme-profile repository to your GitHub account.

2. Create a Personal Access Token

  1. Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
  2. Click "Generate new token (classic)"
  3. Name the token (e.g., github-readme-profile)
  4. Select scopes: repo and user
  5. Click "Generate token"
  6. Copy the token (it appears only once)

3. Import the Project to Vercel

  1. Log in to Vercel
  2. Click "Add New…" → "Project"
  3. Select your forked repository
  4. Click "Import"

4. Configure Environment Variables

  1. On the configuration page, add an environment variable:
    • Name: GH_TOKEN
    • Value: [the personal access token you created]
  2. In "Build & Output Settings", enable "Install command" and add: npm install typescript

5. Deploy

Click "Deploy". Vercel will automatically build and deploy your instance.

Using Your Instance

After deployment, you will get a unique URL like:

https://your-project.vercel.app

Use this URL instead of gh-readme-profile.vercel.app in all examples:

![GitHub Stats](https://your-project.vercel.app/api?username=FajarKim)

Advanced Configuration

Custom Domain

You can add a custom domain in Vercel via the "Domains" tab.

Additional Environment Variables

Variable Description
GH_TOKEN GitHub personal access token (required)
CACHE_DURATION Cache duration in seconds (default: 7200 / 2 hours)

Important Notes

  • Ensure your GitHub token has the necessary permissions to fetch public and private repository data (if needed)
  • The free Vercel plan has usage limits. For heavy usage, consider a paid plan or alternative hosting.
  • If you encounter issues, check the deployment logs in the Vercel dashboard.

Clone this wiki locally