Field notes

A Polar + Next.js template for selling digital downloads (no database)

2026-07-03 · 3 min read · BrackenKit Guides

Polar's official @polar-sh/nextjs adapter gets you a checkout route in five lines. What it doesn't get you is a store. Between "npm install" and "someone bought my icon pack" sits a day of unglamorous work that every download-seller does from scratch — this article walks through all of it, so you can either build it yourself or skip ahead.

Full disclosure up front: we sell a ready-made template that is this article in zip form. The walkthrough below is complete on its own; the template exists for people who'd rather spend the day on their actual product.

Why Polar for downloads at all

Covered in depth in our earlier post on the no-Gumroad setup, but the short version: Polar is a merchant of record with a full API. It charges the buyer, handles VAT/GST in 60+ countries as the legal seller, emails the receipt, and delivers the file. Fees are 5% + 50¢ per sale on the free plan (Polar repriced in May 2026; paid plans lower the rate) versus Gumroad's ~10% flat. For a UK sole trader selling £12–£19 products to buyers anywhere, "someone else owes the German VAT" is the feature.

The catch nobody mentions: Polar gives you a hosted checkout, not a storefront your brand lives on. If you want your own domain, product pages that rank, and a design that isn't a payment provider's default — you're building a site.

The parts you actually have to build

1. The checkout route. The adapter's Checkout() handler needs an access token, a success URL containing the literal string {CHECKOUT_ID} (miss this and your thank-you page can't show an order reference), and a server flag that must match the token's environment — a sandbox token against production 401s in a way that's not obvious from the error. Budget an hour for the round trip of understanding this.

2. A catalog that doesn't need a CMS. For a handful of products, a typed TypeScript array is the right amount of infrastructure: slug, name, tagline, price label, Polar product ID, cover image, markdown description. Product pages, the homepage grid, sitemap.xml and per-page metadata all generate from that one file. No database, no admin panel, nothing to patch in six months.

3. The success page. Read checkout_id from the query string, confirm the order, tell the buyer the receipt and download link are in their email. Skipping this and dumping buyers back on the homepage is the single most common flow-break in indie stores.

4. Product presentation. This is the part that takes the day. Cards need cover images (a 4:3 aspect with object-fit: cover — and note that an <img height> attribute silently overrides CSS aspect-ratio; we lost an hour to portrait-cropped covers), pages need feature lists and honest copy, and the whole thing needs to not look like a default starter, because buyers judge a £15 icon pack by the shop it hangs in.

5. The forgettable 20%. Open Graph images so shared links show something. robots.txt and a sitemap. A 404 that links back to the store. Dark mode if you care. A webhook endpoint (Polar signs its webhooks; the payload format must be set to "Raw") for the day you want licence keys or a mailing list — you don't need it on day one, but wiring it later means redeploying with a new secret.

6. Sandbox-first testing. Polar's sandbox is a separate account on sandbox.polar.sh with fake money and the classic 4242 4242 4242 4242 test card. Do one full fake purchase — checkout, redirect, email, download — before pointing anything at production. Products don't transfer between environments; you recreate them and swap the IDs.

Build vs buy, honestly

If you enjoy this kind of plumbing or your needs are unusual, build it — everything above plus Polar's Next.js guide is enough of a map, and the official examples repo covers the adapter basics.

If you'd rather not, our Polar Storefront template is the finished version of this article: Next.js 16 + TypeScript, the typed catalog, checkout/success/webhook routes with the gotchas already handled, an editorial design system in plain CSS (three self-hosted typefaces, automatic dark mode, product cover art), a fictional four-product demo shop you can see live at demo.brackenkit.com, and a README that goes from unzip to sandbox test purchase in about ten minutes. £19, commercial licence, built with AI assistance and tested before release — install, production build, every route and error path.

Either way: charge for your work, let a merchant of record fight the tax hydra, and keep your catalog in git where it belongs.