Topics
Recent articles

Developer Tools

How to Keep Free and Pro Chrome Extension Features in One Codebase

Bundle free and paid features in one Chrome extension, gate actions through a shared policy, and keep account switches and offline states safe.

Table of Contents9 sections
Pixel art showing one browser extension package with a shared feature policy branching to free Markdown copy and paid PDF export.
One installed package, one action policy, and two feature paths.

The first Pro feature in a Chrome extension is easy to ship. The trouble starts when you fix Markdown export in the free build, forget to apply the fix to Pro, and now have two archives to test and two support paths to maintain. If the audience and the extension’s core job are the same, you usually do not need a second product. You need one implementation and one clear rule for which actions each account can run.

Quick solution: Ship one Manifest V3 package with the free and paid handlers bundled. Use a shared feature policy to drive the UI and guard commands. Load a verified list of paid capabilities for the signed-in account; never make ordinary free actions wait for billing. Enforce access again on the server for paid services.

One Chrome package
  copyMarkdown  -> free handler, no entitlement fetch needed
  exportPdf     -> bundled handler, check account grant
  batchExport   -> server-backed service, server checks grant again

Make the feature boundary about actions, not screens

Start by naming the operations a user can ask the extension to perform. In a hypothetical note exporter, copying the current page as Markdown is free, while producing PDF or running a batch of exports is paid. The feature names should describe the action, not the pricing tier: exportPdf is more useful in code than isPro. Named operations let you change what a particular plan includes without scattering pricing rules across UI components, message handlers, and tests.

Treat the popup, keyboard shortcut, context menu, and options page as different entry points to a shared dispatcher. Every path to the paid operation should ask the same feature policy. Hiding the button is useful feedback, but it is not a check on another entry point. If you add a keyboard shortcut six months later, you should only have to register a new entry point, not remember how to implement the billing logic again. Keep handler dependencies clear enough that free operations can run without constructing the paid API client.

Do not fork the shared conversion logic to attach a paywall. Free Markdown output and the first step of PDF export can use the same sanitized content model, for example. Only the actual capability and any paid service call should depend on the entitlement. This makes a formatting fix apply to all users without making free users load or initialize everything tied to the paid plan. The package can include lazily loaded local modules if that helps startup, but they are still files in the reviewed package.

Accept a list of capabilities, never remote instructions

Define a small, versioned response that contains an account identifier, expiry, and the names of the paid features available. Translate those names through a local allowlist. The server is allowed to tell this build that an account has exportPdf. It should not send a function body, module URL, or a generic rules language that the extension interprets as executable logic. If a new capability arrives that the installed version does not understand, ignore it; adding a new handler should be a normal extension release.

Chrome’s Manifest V3 guidance on remotely hosted code distinguishes remotely loaded executable code from ordinary data. The point of a capability response is to select from actions already defined and bundled in the package. Do not treat putting remote instructions in JSON as making those instructions acceptable. Inspect the built archive and dependencies, not just source files you wrote, to make sure the extension is not loading executable logic as part of sign-in, payment, or conversion.

A single package is a good baseline when users grant the same relevant permissions and do basically the same job. If PDF export or a paid integration genuinely needs an additional permission, ask for the necessary optional permission at the moment the person chooses that feature, where supported. A subscription is not permission to access more browser content. An authorized feature with a denied browser permission should say what is missing; it should not masquerade as an expired payment.

Put the decision in a small, testable policy

Here is a minimal policy function. It does not fetch or verify an entitlement. It receives a trusted grant normalized earlier by the extension’s entitlement adapter, plus the current signed-in account, session generation, and time. The feature set is composed of known identifiers for this build. The dispatcher calls the function again before an operation begins; the UI can use the result to show the corresponding action.

const FREE = new Set(['copyMarkdown', 'openSavedNotes']);
const PAID = new Set(['exportPdf', 'batchExport']);

function canRun(feature, ctx) {
  if (FREE.has(feature)) return 'allowed';
  if (!PAID.has(feature)) return 'unsupported';
  if (!ctx.accountId) return 'sign_in';
  const grant = ctx.verifiedGrant;
  if (!grant || grant.accountId !== ctx.accountId ||
      grant.sessionGeneration !== ctx.sessionGeneration ||
      !Number.isFinite(grant.expiresAtMs) || !Number.isFinite(ctx.nowMs) ||
      ctx.nowMs >= grant.expiresAtMs) {
    return 'check_access';
  }
  return grant.features.has(feature) ? 'allowed' : 'upgrade_required';
}

The important distinction is between an active grant that explicitly lacks the feature and a state where the extension cannot tell. Only the former should lead directly to an upgrade prompt. If verification is unavailable, offer to retry or explain the offline limit without implying the user has not paid. For a cached denial, you may want a refresh after returning from checkout; do not make a purchase look unsuccessful just because an old grant is still within its refresh interval.

The function also makes unknown feature names fail closed instead of assuming the caller is asking for an ordinary free action. Keep the dispatch table and the policy’s known names aligned with a simple test. If a feature genuinely becomes free in a later version, change the shared policy and verify the behavior at every entry point. Do not keep two copies of the old paid handler fighting over which version gets called.

Make account changes invalidate cached decisions

An entitlement is specific to the account and session for which it was fetched. A common mistake is persisting a single boolean and restoring it when the extension starts, even if a different person is now signed in. Use an account identifier and a session generation that changes on logout or account switch. If a request started for account A finishes after account B signs in, discard that response. Apply the same rule when a refresh finishes after logout. A popup reopened during the transition should see check access, not the old account’s plan.

Chrome provides extension storage areas with different persistence and exposure. Choose intentionally where the cache belongs. Do not put a bearer secret or reusable backend credential into data that less-trusted extension contexts can read. For a persistent cache, store only what your design needs and restrict exposure where appropriate; the popup can ask a trusted extension context for a decision instead of reading the grant directly. Design for an empty cache on a fresh install, a browser restart, or a migration. Free functionality should still be available.

Decide when to verify the cached record again and how long paid local operations can work offline. A time-bounded verified grant can help an existing customer during a brief network outage. The trade-off is that offline state cannot instantly reflect every refund or downgrade. The RayLabs guide to offline license verification covers what signatures and expiry can establish and what a client cannot guarantee. A local clock comparison in a UI policy is not a strong security boundary or a substitute for any server check.

Keep server-side work authoritative

Some paid actions are entirely local. There is no server controlling a downloaded package’s local execution, so do not promise server-grade authorization for a PDF converter bundled in the extension. The local gate is a product behavior for normal clients, and an offline grant can improve honest users’ access. If an operation consumes paid server resources or touches private workspace content, check the account and capability on the server before doing the work. That server decision should not trust the extension’s claimed tier, popup state, or cached entitlement.

Make a denied server response clear enough to drive a useful next action. Sign-in expired, permission revoked, plan lacks batch export, and a temporary service problem are different cases. Avoid wiping a user’s draft because a grant expired halfway through an upload. Keep the local work intact where appropriate, explain what happened, and let the user retry when access is restored. For longer paid operations, decide what happens to already started jobs after a downgrade instead of discovering it through a customer ticket.

Do not conflate identity with billing status. The user’s presence in an account, their access to a workspace, and that account’s plan can change on different schedules. Verify each at the layer that owns the decision. If your first version has no shared workspace, the feature policy can be simpler; just do not let a product-level convenience field become the only permission check when you add collaboration later.

Use one release process for both paths

Document which features are included in the free experience and which require a purchase. Follow the Chrome Web Store monetization policy for the current disclosures and payment handling. Keep the purchase flow separate from the converter’s implementation: returning from a checkout page is not itself proof of a grant. Refresh the account entitlement and show verification in progress until the backend reports the change. The popup should not silently switch to paid mode based on a URL parameter.

Test the built artifact in both states, not just source code with a local flag toggled. Use a clean free install, a test account with an active grant, a grant that expires, and a server denial. A release that works for developers with a permanent test account can still brick the free path by accidentally requiring identity or network initialization. Check an ordinary free action with the entitlement endpoint unavailable. Test a known paid action from both the popup and the shortcut, including a direct attempt through the supported dispatcher without the popup.

Test out-of-order responses by starting a refresh, switching accounts, and delaying the first response until after the switch. Verify that the late grant never attaches to the second session. Add checks for unknown capability names, first launch without stored state, and denied optional browser permissions. For regressions, record the exact package version and the account fixtures used. Test grants should be scoped to your test environment; do not ship routes or debug flags that accept a development grant in production.

Split packages only when the product boundary demands it

One codebase is not necessarily one install in every scenario. An enterprise edition might be privately distributed, need a materially different permission set, or operate in an environment with a different identity provider. In that case two generated manifests or packages can be justified, while shared parsing, conversion, and display stay in the same repository. Have the build generate the differences from reviewable configuration and test each artifact explicitly. A new package should respond to a real distribution or permission constraint, not simply to a wish for two prices.

For the usual independent extension, every new package adds overhead: independent updates, permissions reviews, installation state, data migration, and help instructions. Two builds may also make upgrades feel like reinstalling the product. Before splitting, ask whether bundling both handlers and gating the paid action achieves the same user-facing result with fewer moving parts. If it does, choose one package and use that saved energy to test the hard transitions that a flag alone cannot handle.

Release checklist for a shared free and Pro build

The useful boundary is not the ZIP file. It is the point where an action becomes available and where a service must enforce that availability. Keep the product code together, make that boundary easy to inspect, and test the cases where identity, connectivity, or payment state changes between opening the popup and requesting the feature.

You Might Also Like

View all articles
How Chrome Extensions Actually Make Money
4 min read

How Chrome Extensions Actually Make Money

Compare practical Chrome extension monetization models including subscriptions, paid SaaS companions, licensing, sponsorships, affiliates, and advertising trade-offs.