Skip to main content

Feature flags and expiry fallback

You do not need anything on this page for a basic integration. Come back when you want different plans to unlock different features, or to keep a reduced version working after a license expires.

Feature flags​

A plan can carry a small JSON object of your own settings, for example {"auto_backup": true, "export_limit": 50}. You set it on the plan in the admin panel. Licensr returns it as feature_flags on validate and activate, and inside the token's claims. If the plan has none, the field is null.

Default every flag to off (or the lowest tier) when it is missing, so old plans keep working.

const flags = result.featureFlags ?? {};
if (flags.auto_backup === true) enableAutoBackup();
const exportLimit = typeof flags.export_limit === 'number' ? flags.export_limit : 10;

Entitlement and fallback​

valid is still the field you gate on. One extra field helps if you want to offer reduced access after a license expires:

FieldValuesMeaning
entitlementfull / limited / nonefull when valid, limited when expired on a fallback plan, none if cut off.

limited only ever appears for an expired license on a perpetual-fallback plan.

On natural expiry of a fallback plan the response is valid: false, status: "expired", entitlement: "limited". A client that only checks valid stays locked. A newer client can offer a reduced mode:

if (result.valid) unlockFull();
else if (result.entitlement === 'limited') unlockDegraded();
else showExpired();

An admin deactivation, a refund, or the end of a grace period always returns entitlement: "none".