Working sample  /  Cloudflare + Lemon Squeezy + Resend

From paid order to working license key

This is a live license-key service running on Cloudflare Pages Functions. Place a test order and the page shows each step: the webhook Lemon Squeezy would send, the signature check, the key issued, the email handed to Resend, and activation in the desktop app. Renewals and upgrades reuse the key from the last order.

Test mode: nothing is charged and no email leaves the server. The Resend request is shown instead.


Choose a product and place a test order.

What the full setup covers

The same pieces, wired to your real accounts, with each milestone checked before moving on.

1 · Site and domain

  • DNS moved to Cloudflare with existing mail records copied first, so email never drops.
  • SPF, DKIM and DMARC for both the mailbox provider and Resend.
  • Site on Cloudflare Pages with HTTPS on www and the apex. Downloads served from a separate subdomain (R2 or Pages).

2 · Checkout and keys

  • Six products/variants in Lemon Squeezy; checkout links in the site settings file.
  • Webhook signed with a secret stored in Cloudflare, never in the repo. Bad signatures are rejected (try it above).
  • Resend sends from your domain, with an idempotency key so a retried webhook never sends two emails.

3 · Signed installers

  • Windows: signtool with your code-signing certificate (or Azure Trusted Signing), publisher name shown in the installer prompt.
  • Mac: Developer ID signing, notarytool submit and staple, run on a macOS build machine in GitHub Actions.
  • Installers and update files uploaded to the download area, with links checked.

4 · Test and hand over

  • Buy → email → download → install → activate on Windows and Mac, plus renewal, upgrade and an app update; test orders refunded.
  • Secrets and access review: who holds which API key, and rotation steps.
  • Short written notes and a 30-minute walkthrough: releasing an update, resending a lost key.