PaidExtension

Documentation

Overview of what ships in the kit. The full guides — docs/setup.md, docs/licensing.md, docs/publishing.md — are in the repository you receive after purchase.

What you need

Repository layout

paidextension.config.json   single source of truth: product, company, URLs, plans, seats, trial, feature gates
extension/                  MV3 extension (TypeScript, webpack, vitest)
worker/                     licensing Worker (JS ESM + JSDoc, node:test, wrangler)
site/docs/                  GitHub Pages root: landing, checkout, key, devices, privacy, terms, support
scripts/                    init (rebrand), validate-config, generate-listing (+ tests)
docs/                       setup, licensing, publishing guides
.agents/skills/             agent skills: setup, publish, test
.github/workflows/          ci.yml, pages.yml, release.yml

The setup path (about an hour)

  1. Rebrand. npm run init asks for product name, company, support email, site URL, seats and trial days, then rewrites the config and every file mirroring it: manifests, wrangler.toml, the site's HTML and CSP, CNAME, tests. Non-interactive mode for agents: npm run init -- --from answers.json.
  2. Signing keypair. cd worker && npm run keygen -- --write generates an ES256 keypair, writes the public half into the extension and prints the private half for the Worker secret. Production builds refuse to ship while the development key is still in place.
  3. Paddle. Create one product with monthly, yearly and one-time (lifetime) prices, a server API key, a client token and a webhook destination pointing at /webhook. The guide lists the exact seven events to subscribe to.
  4. Deploy the Worker. wrangler kv namespace create, four wrangler secret put calls, npm run deploy. GET /health reports which secrets and prices are configured.
  5. Email (optional). Verify a sending domain in Resend and set the API key. Without it buyers still get Pro — the extension polls for its key after checkout.
  6. Site. Enable GitHub Pages for site/docs, add a CNAME record, enforce HTTPS.
  7. Walk the golden path in sandbox. Trial → upgrade → Paddle overlay → test card → Pro within a minute → key in Settings → activate on a second profile → release a seat.
  8. Go live. Swap in production Paddle ids and tokens; npm run build refuses sandbox values. Then follow docs/publishing.md for the Chrome Web Store, Edge Add-ons and Firefox AMO.

Using an AI coding agent? Point it at .agents/skills/setup/SKILL.md. It walks the same steps and knows how to verify each one.

Licensing architecture

License keys are JWTs signed with ES256 (P-256). The private key lives only in Worker secrets; the public key ships in the extension, so a key verifies with no network call.

Worker routes

GET  /health          configuration booleans, never secrets
POST /checkout        {plan} → Paddle transaction id
POST /trial           {visitorId} → trial key
GET  /license?txn=    poll for the key after checkout
GET  /status          license status for a key
POST /activate        {key, installId} → entitlement token
POST /deactivate      {key, installId} | {key, all: true}
POST /seats           {key} → plan, status, expiry, devices
POST /webhook         Paddle (signature-verified)
POST /resend-webhook  Resend delivery events (Svix-verified)

Costs

ItemCost
Cloudflare Workers + KVFree tier: 100k requests/day, 1k KV writes/day
GitHub PagesFree
Paddle5% + 50¢ per sale, no monthly fee; handles VAT/sales tax, invoices, refunds
ResendFree tier: 3,000 emails/month
Domain~$12/year

Commands

WhereCommandWhat
rootnpm run initRebrand from the sample product to yours
rootnpm run validate:configConfig schema + cross-file consistency
rootnpm run generate:listingStore listing, permission justifications, data-use disclosure
rootnpm run checkEverything below, in order
extensionnpm run build / build:firefox / build:devProduction, Firefox or dev bundle
extensionnpm run packageZips for store upload
workernpm run keygen -- --writeNew ES256 keypair
workernpm run dev / deploy / tailWrangler
sitenpm run checkESLint, html-validate, link check, CSP check

Agent skills

AGENTS.md records the invariants: private keys only in Worker secrets, licensing code outside the service worker's hot path, strict per-page CSP on the site, unknown Paddle prices fail closed.

Support

Buyers get support through GitHub Issues on the private repository and by email at hello@paidextension.dev. Pre-sales questions are welcome at the same address.