extcharge

Blog

How to accept payments in a Chrome extension (Manifest V3)

1 December 2026

Most Chrome extensions start free and add a paid tier later. The user clicks "Upgrade", pays, and expects the extension to unlock. That sounds simple. In a Manifest V3 extension it is not, because an extension has no server of its own, and anything it ships to the user is visible to the user.

The problem with checks inside the extension

An extension is a package the browser installs from the store. Its JavaScript, its constants and its API URLs are readable by anyone who installs it, and an unpacked copy can be edited in minutes. Two consequences follow.

Client-side state is fine for interface decisions. It is not proof that someone paid. The proof has to come from a system the user cannot edit: Stripe, plus a record that a server keeps for you or that a service keeps for you.

Manifest V3 constraints that shape the design

What a payment system has to do

Whatever you build, it has to cover five things:

  1. Take the payment, including the authentication steps that some cards require.
  2. Record the paid state against an identity.
  3. Keep that state in sync with renewals, failed renewals, cancellations and refunds.
  4. Let a paying user get access back on a new device or after a reinstall.
  5. Answer the extension quickly, and keep working when the network does not.

The identity question is the hard one. Extensions have no login by default. The usual choices are a random install ID stored in chrome.storage.local, which is lost on reinstall, or an account with an email address the user confirms. The install ID is simple and private but cannot follow a user. The account is portable but adds a sign-up step. Pick one before you write any payment code.

The DIY architecture in outline

A minimal self-built setup has four parts: the extension, a backend, Stripe Checkout and Stripe webhooks.

  1. Identity. The extension creates a random ID on first run and stores it in chrome.storage.local.
  2. Checkout. The extension calls your backend, for example POST /checkout. The backend creates a Stripe Checkout Session in payment or subscription mode, sets client_reference_id to the extension ID, and puts the plan in the session metadata. It returns the session URL, and the extension opens it in a new tab.
  3. Payment. Stripe Checkout collects the payment and redirects the user to your success page.
  4. Webhooks. Stripe sends events to your endpoint, for example checkout.session.completed, customer.subscription.updated, customer.subscription.deleted, invoice.payment_failed and charge.refunded. Your handler verifies the Stripe-Signature header against the raw request body, then writes the entitlement to your database.
  5. Check. The extension asks your GET /license endpoint with its ID, caches the answer with a timestamp in chrome.storage.local, and refreshes it in the background.

The database is the source of truth, and the extension holds a cache. The success redirect is not proof of payment, because a user can open the success URL without paying. Only the webhook counts.

What to watch out for

The hosted route

A hosted service takes over the backend parts. With ExtCharge you connect your own Stripe account through Stripe Connect (Standard), register your extension in the dashboard, and add your plans. Payments are direct charges on your Stripe account, and ExtCharge never holds the money. Webhooks, subscription states and the license check run in the service. The extension code stays short:

// background.js
importScripts("ExtCharge.js");
const extcharge = ExtCharge("your-extension-id");
extcharge.startBackground();
// popup.js
const extcharge = ExtCharge("your-extension-id");
document.addEventListener("DOMContentLoaded", async () => {
  const user = await extcharge.getUser();
  if (user.paid) enablePro();
  else document.querySelector("#upgrade").onclick = () => extcharge.openPaymentPage();
});

The manifest needs the storage permission and a content script on https://pay.extcharge.com/* that loads ExtCharge.js. The full manifest and the setup steps are in the integration guide.

Two details matter. The background script must call startBackground(), because that is where the paid and trial signals arrive. And the content script on the payment domain is what tells the extension that a payment succeeded, so it is required for onPaid.

Trade-offs

If you need to own every line of the payment path, build it. If you want the webhook, subscription and license parts done and maintained by someone else, the hosted route saves the most time. Either way the first decision is the same: the check that unlocks a feature must come from a server, not from the extension.

Try ExtCharge on your extension

Connect your Stripe account, register your extension and add a plan. The dashboard walks you through it.