ragibalasad
thanks-for-the-star
TypeScript

Star this repo and get an instant follow back ๐Ÿ’–

Last updated Jun 12, 2026
65
Stars
3
Forks
1
Issues
0
Stars/day
Attention Score
35
Language breakdown
TypeScript 94.8%
JavaScript 5.2%
โ–ธ Files click to expand
README

GitHub Repo stars

Automatically follow people who star your repo โœจ
Give back with a follow, powered by Next.js & GitHub Webhook

Star this repo and get an instant follow back ๐Ÿ’–

##

A Next.js 14 serverless GitHub webhook API to auto-follow users who star your repo โ€” ported from the Python version to Next.js API route with full secret verification and logging.

How it works

When someone stars this repo, GitHub sends a webhook that triggers this API. It:

  • Validates the webhook signature
  • Follows the user by sending a PUT request to https://api.github.com/user/following/{username} with the GitHub token in the Authorization header (Bearer <token>).

Features

  • Secure webhook secret validation
  • Instant follow-back of new stargazers
  • Simple setup with environment variables
  • Logs for success and errors

Setup

You can set this up yourself to automatically follow users who star your repository.

  • Clone or download this repo
  • Rename .env.example to .env.local and fill in your values:
GITHUBTOKEN=yourgithubpersonalaccess_token
GITHUBWEBHOOKSECRET=yourwebhooksecret
  • The GitHub token needs the user:follow scope.
  • Deploy on Vercel
  • Add the webhook URL to your GitHub repo settings:
https://your-vercel-app.vercel.app/api/webhook
  • Content type: application/json
  • Secret: same as GITHUBWEBHOOKSECRET

Logs & Debugging

Logs are printed in Vercel serverless function console.

License

BSD-3-Clause license

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท ragibalasad/thanks-for-the-star ยท Updated daily from GitHub