Sell software straight from your private Github repo. Payment via Gumroad, deployment via Vercel
- In Gumroad, create a new application: https://app.gumroad.com/settings/advanced and an access token
- Clone this repo and deploy it to Vercel, create an environment variable
GR_TOKEN
with the Gumroad access token you received in step one - Create a new product on Gumroad and choose
redirect to URL after purchase
as the delivery method - Set the URL to https://{your-project-name}.vercel.app/api/download
- Done! All files in the
dist
-folder will automatically be zipped and downloaded once a user purchases your product! The sale_id that is sent with the request from Gumroad, is verified against the Gumroad API. If a sale_id is not found, users will see an error.
I have not yet found out how to zip/download files that are generated by a build step (and if that's possible at all via Vercel). So for now, this only works for source files, or files you've built and committed ahead of time. You can however also include extra files at run time (see api/download.js), which opens up possibilities for user-generated content.
You can use the public
folder to create you custom product page and link to your product page on Gumroad.