Protected Downloads with Supabase, Stripe, R2, and Cloudflare
A practical overview of how ImgKit connects login, checkout, product access, private files, and signed download URLs.
Paid digital products need a boring but important foundation: buyers should be able to pay, sign in, and download the right file without exposing a public ZIP link.
ImgKit uses a simple protected download pattern:
- Supabase handles login.
- Stripe handles checkout.
- The application records product access.
- R2 stores private files.
- Cloudflare Functions return short-lived signed URLs.
Why Protected Downloads Matter
If a paid ZIP file lives in a public folder, anyone with the URL can share it. That may be acceptable for free samples, but it is weak for paid products.
Protected downloads add a server-side check:
- Who is the user?
- Did this user buy the product?
- Is the download asset active?
- Can the server generate a temporary URL?
The user still gets a normal browser download, but the permanent storage path is not public.
Supabase Login
Supabase gives ImgKit an account identity. A buyer signs in with email, then checkout and downloads can be attached to that account.
For early products, email login is enough. Buyers do not need a complicated dashboard just to download a protected file.
Stripe Checkout
Stripe handles the payment session. The buyer starts checkout from the site, pays, and returns to ImgKit.
The server then needs to connect the completed session to product access. That can happen through webhooks and a checkout sync endpoint so the buyer sees access soon after payment.
Product Access
Product access should be separate from generic membership labels. A buyer may own one product but not another.
For ImgKit, the retired Builder Case Study used its own product entitlement. That model still lets future products exist without turning every buyer into a broad subscription member.
R2 Private Storage
R2 stores the actual ZIP package outside the public website bundle. The site does not link directly to the R2 object.
Instead, a download endpoint checks access and asks storage for a temporary URL.
Signed URLs
A signed URL gives temporary access to a private file. If the URL expires after a short window, it is less useful to share permanently.
This is not heavyweight DRM. It is a practical paid-delivery boundary for an MVP.
What ImgKit Learned
The archived ImgKit Builder Case Study page preserves the surrounding implementation decisions: why paid software sales were paused, how protected downloads were shaped, and how the source-code package was tested as a first paid offer.
That context matters because the technical flow is only half the product. The other half is deciding what should be sold first.
FAQ
Why not put paid ZIP files in a public folder?
Public files can be shared directly. Protected delivery lets the server check account access and return short-lived download URLs.
Does Stripe store the file?
No. Stripe handles payment. Product access and download delivery are handled by the application and private storage.
Why use signed URLs?
Signed URLs let a private file be downloaded for a limited time without exposing permanent storage access.
Resources
References
Use these references to move between the guide, the matching supporting pages, and the people behind the content.
Plan a repeatable batch image conversion workflow for website launches, redesigns, migrations, and product catalogs.
Read guideHow I Built an AI-Assisted Image SaaS with Astro, Supabase, Stripe, R2, and ElectronA practical launch story behind ImgKit: free browser image tools, protected downloads, Stripe checkout, an Electron desktop app, and an AI-assisted build workflow.
Read guideHow to Sell a Source-Code Case Study Before Your SaaS Is Fully MatureA practical framework for turning a real MVP build into a paid educational product without pretending the software is more mature than it is.
Read guideLeon PatelCreates how-to guides and photo tips that keep the advice simple, clear, and ready to use in Gift Studio.
View authorDylan RossChecks guides and photo tips for freshness, usefulness, and a calm editorial voice.
View reviewerOpen Gift StudioApply the guide in the editor when you are ready to make the gift.
Create a giftSee how the article was reviewed, then use the buttons below if something needs attention.
Editorial policyTopic graph
Keep exploring Protected Downloads with Supabase, Stripe, R2, and Cloudflare
Follow the connected pages below to move from this topic into the closest guides, messages, examples, decoration guides, recipient guides, occasions, and memory guides.
Related Guides
Use these how-to pages when you need the next practical step.
A practical guide to choosing the right photo for a personalized gift, including image clarity, emotion, and message fit.
Read tipPhoto Editing TipsResize, crop, compress, and convert photos so they are ready for the gift workflow.
Read guideGift Ideas GuideA practical starting point for choosing a personalized gift idea that fits the occasion and the timeline.
Read guideRelated Messages
Use these message pages when the wording needs to match the tone.
Related Examples
Compare finished examples to check the direction before you decide.
Related Decoration Guides
Choose the style direction that supports the photo and message.
Related Recipient Guides
Match the gift to the person or relationship first.
Related Occasions
Narrow the choice by the occasion that matters most.
Explore birthday photo gift ideas, best photo types, message examples, and practical tips before you open ImgKit Gift Studio.
Open ideasNew baby photo gift ideas for a sweet welcomeExplore new baby photo gift ideas, best photo types, message examples, and practical tips before you open ImgKit Gift Studio.
Open ideasRetirement photo gift ideas that feel proud and thoughtfulExplore retirement photo gift ideas, best photo types, message examples, and practical tips before you open ImgKit Gift Studio.
Open ideasRelated Memory Guides
Keep the archive, timeline, or legacy context clear.
Turn a meaningful photo into something you can revisit, save, print, or keep private.
Read guideFamily HistoryTurn photos, names, and milestones into a family story that is easier to understand across generations.
Read articleFamily ArchiveBuild a shared archive that relatives can understand, search, and add to over time.
Read articleRelated Articles
Read the latest articles for deeper context on this topic.
Learn why personalized gifts build stronger relationships by showing attention, preserving memories, and turning shared moments into lasting keepsakes.
Read articleUnique Anniversary Gift Ideas for CouplesFind unique anniversary gift ideas for couples, from personalized photo keepsakes to romantic memory gifts that celebrate real shared history.
Read article50 Best Personalized Gift IdeasExplore 50 meaningful personalized gift ideas for birthdays, anniversaries, memorials, weddings, holidays, and everyday moments of appreciation.
Read articleRelated Tools
Use these free browser tools to prepare, edit, or convert your images.
Convert images between JPG, PNG, and WebP in your browser. Free, private, fast, and local for supported files.
Open toolImage to PDF ConverterConvert JPG, PNG, and WebP images into a single PDF in your browser. Free, private, and local for supported files.
Open toolImage CompressorReduce image file size locally with practical quality controls for website and product images.
Open tool