ARTICLE
How a Chrome Extension Should Validate a Paid License
License validation is the bridge between a purchase and the premium behavior inside the extension. It needs to handle activation, refresh, expired access, network failure, and support recovery.
A practical flow looks like this:
- The customer purchases through Polar.sh.
- The customer receives a license key or entitlement claim path.
- The extension options page asks for the license key.
- The extension sends the key to a Cloudflare Worker validation API.
- The Worker checks Polar.sh or the entitlement database.
- The extension caches the result in
chrome.storage. - Premium features read the cached result and refresh it when needed.
The extension should not call Polar’s management API directly. Distributed extension code cannot protect secret tokens.
Design the validation response for UI and product logic. Fields such as active, planName, expiresAt, features, checkedAt, and reason are usually enough. Avoid returning internal IDs or unnecessary personal data.
Network failure needs a policy. If validation succeeded recently, you may allow a short grace period. If validation has not succeeded for a long time, the extension can disable premium actions, show recovery instructions, or ask the user to retry.
If you enforce device limits, add activation records. A first validation creates an activation. Later checks include that activation id. Users also need a way to deactivate old devices.
Do not rely only on hiding UI. If premium features call your server or consume costly resources, the server must check entitlement too.
References
- Chrome Extensions Get started: https://developer.chrome.com/docs/extensions/get-started/
- Chrome Extensions Declare permissions: https://developer.chrome.com/docs/extensions/develop/concepts/declare-permissions
- Chrome Extensions Storage API: https://developer.chrome.com/docs/extensions/reference/api/storage
- Chrome Web Store Program Policies: https://developer.chrome.com/docs/webstore/program-policies/policies
- Chrome Web Store User Data FAQ: https://developer.chrome.com/docs/webstore/program-policies/user-data-faq
- Polar Documentation: https://docs.polar.sh/
- Polar Webhook Endpoints: https://polar.sh/docs/integrate/webhooks/endpoints
- Polar Automated Benefits: https://docs.polar.sh/features/benefits/introduction