Cuely is now open source. See exactly what it receivesCode on GitHub

Recipe · checked November 20, 2026

Browser extension with accounts and a paid plan

A Manifest V3 extension for Chrome (and Edge and Firefox) that signs users in, talks to your own backend, and unlocks paid features after checkout on your website. All extension code ships in the package, secrets and model calls stay on your server, and the extension asks for the fewest permissions it can.

Tool bills at 1,000 usersAbout $40/month
Setup steps7
Tools in the stack7

Fits when

  • The product lives in the browser: it reads or changes pages, adds a side panel or popup, or works across sites.
  • Users sign in so their settings and data follow them between browsers.
  • You charge for a pro plan or usage.

Not for

  • A product that works as a normal website: a web app is easier to ship and update.
  • Extensions that collect browsing history or page contents for resale: store policies forbid it.
  • Safari-only extensions: they're built and shipped through Xcode and the App Store, which this recipe doesn't cover.

The stack

CategoryPickWhyPick something else when
HostingHosts the website (sign-in, pricing, checkout, account) and the API the extension calls. Clerk's Sync Host shares the website's sign-in with the extension.
AuthIts Chrome Extension SDK signs users in inside the extension and can sync the session from your website (Sync Host), so users sign in once.
  • Supabase Auth: You already use Supabase for the database and will handle the extension session yourself.
DatabaseUsers, plans, settings and usage, behind your API; the extension never talks to the database directly.
  • Supabase: You want database, auth and storage from one vendor.
PaymentsCheckout and the customer portal run on your website; the extension asks your API which plan the user has.
  • Paddle: You sell worldwide and want a merchant of record to handle sales tax and VAT.
MonitoringErrors from the extension's service worker, popup and content scripts, plus your API, with the extension version on every event.
EmailSign-in links, receipts and 'what's new' emails.
  • Postmark: Transactional deliverability matters most.
AnalyticsoptionalWhich features people use, measured from your API or the website, with no tracking of the pages users visit.
  • Plausible: You only want website traffic numbers.

About $40/month at 1,000 users in tool bills: Vercel $20 + Resend $20; $0 for Clerk, Neon, Stripe, Sentry. Usage profile: 1,000 monthly active users with light use: about 100,000 requests, 3,000 emails, 200,000 analytics events and 5 GB of stored files a month, and a database under 1 GB. AI apps add 50 questions per user a month at about 4,000 input and 500 output tokens each (200M input and 25M output tokens). Internal tools are priced for 10 staff instead.

Catches that change the plan

Setup steps

  1. Scaffold a Manifest V3 extension with a build tool

    A framework handles the manifest, reloads and per-browser builds so you write normal TypeScript and React.

    • Start with Plasmo (Clerk's extension quickstart uses it) or WXT, in TypeScript.
    • Decide the surfaces you need: popup, side panel, options page, content scripts, background service worker.
    • Keep the website (sign-in, pricing, account) as a separate Next.js app on your own domain.
    npm create plasmo@latest my-extension
    npx create-next-app@latest my-extension-site --ts --app

    Done when: The extension loads unpacked in Chrome, its popup opens, and a code change reloads it.

    Docs: docs.plasmo.com, developer.chrome.com

  2. Ask for the fewest permissions

    Every permission shows a warning at install and draws more review; broad host access is the biggest one.

    • Use activeTab to act on the current page after a click instead of host access to every site.
    • If you need specific sites, list only those in host_permissions; use optional permissions for features most users won't turn on.
    • Don't request tabs, history or all-sites access unless the core feature needs it, and say why in the listing.
    package.json (manifest section)
    {
      "manifest": {
        "permissions": ["storage", "activeTab", "cookies"],
        "host_permissions": ["https://your-site.com/*", "https://YOUR_CLERK_FRONTEND_API/*"],
        "optional_host_permissions": ["https://*/*"]
      }
    }
    

    Done when: Installing the extension shows only the warnings you expect, and the core feature works with no all-sites permission.

    Docs: developer.chrome.com

  3. Sign users in once, on the website and in the extension

    Users sign in on your website and the extension picks up the session.

    • Add Clerk to the website, then install @clerk/chrome-extension in the extension.
    • Turn on Sync Host so the extension reads the session from your website's domain; add that domain and Clerk's frontend API to host_permissions.
    • Set a fixed extension key (the manifest key) so the extension id doesn't change between builds, and allow that id in Clerk.
    • Note that Clerk's SDK doesn't fully support Sync Host in side panels yet; use a popup or options page for sign-in.
    npm i @clerk/chrome-extension

    Done when: Signing in on the website makes the extension show the signed-in user without a second sign-in.

    Docs: clerk.com, clerk.com

  4. Keep secrets and business logic on your backend

    Anything in the extension package can be read by anyone who installs it.

    • Put API keys (model APIs, Stripe) only on your server; the extension calls your API with the user's session token.
    • Check the user's plan and usage limits on the server for every paid feature, never only in the extension.
    • Ship all extension code in the package: Manifest V3 doesn't allow loading and running remotely hosted code. Fetch data and settings, not code.
    • Validate everything content scripts send to your API; pages can tamper with them.
    site/app/api/me/route.ts
    import { auth } from "@clerk/nextjs/server";
    import { db } from "@/db";
    
    // The extension calls this with the session token to learn the user's plan and limits.
    export async function GET() {
      const { userId } = await auth();
      if (!userId) return Response.json({ error: "signed_out" }, { status: 401 });
      const account = await db.accountFor(userId);
      return Response.json({ plan: account.plan, usage: account.usageThisMonth, limit: account.monthlyLimit });
    }
    

    Done when: Searching the built extension for your secret keys finds nothing, and a paid feature called by a free user is refused by the API.

    Docs: developer.chrome.com

  5. Take payments on your website

    Checkout happens on the website; the extension only reads the plan.

    • Add a Stripe Checkout page for the pro plan and the customer portal for cancelling and invoices.
    • Handle Stripe webhooks on the server to set the user's plan.
    • In the extension, show the upgrade button as a link to your pricing page, and refresh the plan from /api/me after checkout.
    npm i stripe

    Done when: Buying the pro plan on the website unlocks the paid feature in the extension within a few seconds, and cancelling in the portal locks it again at period end.

    Docs: docs.stripe.com, docs.stripe.com

  6. Publish to the Chrome Web Store, then Edge and Firefox

    Store review checks permissions, privacy disclosures and the listing.

    • Register a Chrome Web Store developer account (a one-time $5 fee) and verify your contact email.
    • Write the listing: what it does, screenshots, and a justification for each permission.
    • Fill in the privacy practices form honestly and link a privacy policy that says what you collect and why.
    • Build Edge and Firefox versions from the same code with your build tool and submit them to their stores.

    Done when: The extension is approved and installs from the store listing, and the privacy disclosures match what the code sends.

    Docs: developer.chrome.com, developer.chrome.com

  7. Ship updates safely and watch errors

    Updates go through review, and you can't hotfix code outside the package, so test before each release.

    • Add Sentry to the service worker, popup and content scripts, with the extension version as the release.
    • Keep a changelog and bump the version every release; roll out to a percentage first if the store lets you.
    • Make the API backward compatible: older extension versions stay installed for days after an update.

    Done when: Errors show the extension version they came from, and the previous version keeps working against the new API.

    Docs: docs.sentry.io

Best practices

  • Request the fewest permissions; prefer activeTab and optional permissions.
  • Keep every secret and every paid-feature check on your server.
  • Ship all code in the package; fetch data and settings, not code.
  • Take payments on your website and have the extension read the plan from your API.
  • Keep your API compatible with older extension versions.
  • Tell users plainly what page data you read and why.

Pitfalls

  • Putting an API key inside the extension, where anyone can extract it.
  • Asking for access to all sites when activeTab would do, and getting slower reviews and fewer installs.
  • Loading scripts from your server at runtime, which Manifest V3 doesn't allow.
  • Checking the paid plan only in the extension, so editing local storage unlocks it.
  • Changing the API in a way that breaks extension versions users haven't updated yet.
  • Privacy disclosures that don't match what the extension actually sends.

Costs and obligations

These point to obligations to check; they aren't legal or tax advice.