extcharge

Blog

Free trials in Chrome extensions that users can't reset

1 December 2026

A free trial that restarts every time someone reinstalls the extension is not really a trial. It is a loophole, and it shows up later in your numbers. This article covers why trials kept in extension storage reset, how to tie a trial to a confirmed email on the server, how ExtCharge implements that, and where to decide the trial length.

Why storage-based trials reset

The most common first version looks like this:

chrome.runtime.onInstalled.addListener(() => {
  chrome.storage.local.set({ trialStart: Date.now() });
});

It works in testing and fails in production. The value lives in the browser profile, and users can remove it in several ways:

Some users do this on purpose. Many more do it by accident, for example during a profile migration. Your trial clock then measures how long a user has kept the same browser profile, not how long they have used your product.

chrome.storage.sync carries values between signed-in browsers, but it is still client data and it can still be cleared. It does not fix the problem.

Bind the trial to a confirmed email

A trial that the server starts, tied to an email address the user has confirmed, moves the clock out of the browser. Each email gets one trial. A user with a second email can start another, so the limit is not perfect. The goal is to make abuse take effort, not to make it impossible. Confirmation also gives you a contact address, which a storage counter never does.

The trade-off is friction. Some users will not click the link, and some will read your confirmation mail as a sales message. Accept that cost on purpose and measure it.

How ExtCharge implements it

The trial flow has three parts. The extension calls openTrialPage(), which opens a hosted page where the user enters an email address. The service sends a confirmation link. When the user confirms it, the server sets trialStartedAt for that install. The extension reads the value with getUser(), and the background script can react to the start with an onTrialStarted listener.

// popup.js
const extcharge = ExtCharge("your-extension-id");
document.querySelector("#try").onclick = () => extcharge.openTrialPage("7-day");

The "7-day" argument only changes the heading of the hosted page, so it reads "Start your 7-day free trial". It does not set the length. The length is your code's decision, which is the next section.

Decide the trial length in code

The server records when the trial started. Your extension decides how long it lasts. One helper keeps that logic in one place:

const TRIAL_DAYS = 7;
const DAY_MS = 86400e3;

function trialDaysLeft(user) {
  if (!user.trialStartedAt) return 0;
  const end = new Date(user.trialStartedAt).getTime() + TRIAL_DAYS * DAY_MS;
  return Math.max(0, Math.ceil((end - Date.now()) / DAY_MS));
}

The gate then uses it:

const user = await extcharge.getUser();
if (user.paid || trialDaysLeft(user) > 0) {
  enablePro();
} else {
  showUpgrade();
}

Two notes. First, the expiry check runs in the extension, so a determined user can change it. What they cannot do with that change is start a second trial, because the start time is set on the server. If the length itself must be enforced by a server, you need an endpoint that answers the question, which is the DIY route described in our article on accepting payments in a Chrome extension. Second, wrapping the value in new Date() makes the arithmetic work whether it arrives as a Date or as a string.

What happens when the trial ends

UX tips for asking for an email

The short version

Keep the trial clock on the server and bind it to a confirmed email. Keep the length in one function in your extension. Accept the friction and measure it. The trade-off is never zero: a storage counter is free to build and easy to reset, and a server-side trial needs an email step and a backend. Choose the one that matches how much abuse you can tolerate.

ExtCharge does the server side with openTrialPage() and trialStartedAt. The full setup is in the integration guide.

Add a server-side trial to your extension

Create an account, register your extension and add a plan. Trials start when a user confirms their email.