Sell-a-File Kit · v1.0 · by Gunārs Miezītis (Latvia)
Sell a digital file with a Stripe Payment Link, with no server and no monthly fee
You made a PDF, template, dataset or ZIP and want to charge for it. You don't want Gumroad's cut, a backend, or "email me and I'll send it". This kit is the small piece in the middle: after checkout, only buyers who actually paid get the file, through links that expire.
Buy the kit for €12 Instant ZIP download · Stripe checkout
How it works
- The buyer pays on a normal Stripe Payment Link.
- Stripe redirects them to your
/thanks/?session_id=… page.
- A Cloudflare Pages Function asks Stripe whether that session is live, paid, complete, from your link and recent.
- If yes, it returns HMAC-signed download links that work for 15 minutes. Your file folder can't be opened directly.
What's in the ZIP
- Pages Functions:
/api/download (checks the session), /api/file (serves the signed file), a block on /files/*, and a per-IP rate limit.
- A ready-made thanks page with Download buttons and plain-English errors.
- A Python script that creates the product, price and Payment Link, with the redirect and the EU "immediate access" consent field already set.
- A script that puts your files in a random private folder and fills in the config.
- 8 tests you can run offline (
node tests/test_download.mjs): unpaid, wrong product, test mode, expired, tampered token, and more.
- A README with the setup steps and restricted-key scopes (the site key only needs Checkout Sessions: Read).
- An EU selling checklist (not legal advice) and a bonus AGENT-GUARDRAILS.md with the rules I give my AI agents so they can help run a store without leaking keys or spamming anyone.
Honest notes
- This is the code behind the checkouts on paygapkit.com and priceofwork.com. Those sites are new. I'm not claiming they've made sales; the code works and is tested.
- You need a Stripe account and a free Cloudflare account, and you should be comfortable running a terminal command or two.
- Signed links stop casual link-sharing. A buyer can still forward the file itself, as with any download.
- Delivery is on the thanks page, not by email. Reloading the page gives fresh links for 30 days.
Buy the kit for €12
Price is final (I'm not VAT-registered, so no VAT is added). It's a digital download: at checkout you ask for immediate access, and your 14-day withdrawal right ends once the download is shown. If something doesn't work, email me and I'll fix it or refund you. Terms and seller details.