Gumroad → GitHub Access Kit: Sell a Private Repo with Automatic Invites and Refund Removal
Selling code as a private GitHub repo on Gumroad? Inviting every buyer by hand is tedious, and removing refunded buyers is easy to forget.
This kit does both automatically. A buyer types their GitHub username at checkout and gets an invite within a minute. If they refund, charge back, or their membership ends, the invite is cancelled and their access is removed.
What it handles:
- Auto-invite on every sale, read-only on organization repos, or add buyers to an organization team
- Auto-removal on refunds, chargebacks, and ended memberships, including cancelling pending invites
- Spoof-proof: Gumroad pings aren't signed, so the kit re-checks every sale with Gumroad's Sales API before acting, and the endpoint needs a secret key
- Safe with retried and out-of-order notifications, and it keeps access when a buyer still owns another product that grants the same repo
- Backfill and repair: one command invites everyone who bought before you installed it and removes anyone since refunded (dry run first)
- Never removes you or anyone on your protected list
- Optional Discord or Slack alerts for you. It never messages buyers.
- Runs on Cloudflare Workers' free tier or any Node 18+ host, with zero dependencies, 19 passing tests, and an MIT license
What you get: a ZIP with the web handler, Cloudflare Worker and Node entry points, a subscribe command that registers Gumroad's refund and membership notifications, reconcile and manual grant commands, an example config, tests, and a step-by-step README (about 15 minutes to set up).
Honest notes: on repos owned by a personal account, GitHub gives every collaborator write access, so use a free GitHub organization for read-only access (the README explains how). GitHub allows 50 repo invites per repo per day. Removing access doesn't delete a copy someone already cloned. Tested against Gumroad's public API and open-source code and GitHub's REST API, with mocked APIs in the tests, so do one real test purchase with a 100% discount code before launch. Not affiliated with Gumroad or GitHub.
Also from me: Gumroad License Kit, drop-in license key checks for Python, Node, and browser apps: https://payhip.com/b/7kUOr