Skip to content

Licensing Phase A Built

Licensing decides what each merchant is entitled to run. Operators define reusable plans (trial, subscription, perpetual) carrying typed feature flags and seat limits; the system issues a license from a plan, binds it to a merchant or user, tracks its lifecycle, and validates it at runtime - returning a signed certificate that the rest of the product trusts offline to gate features and devices. It is used by platform operators (who manage plans and licenses), merchants (who run on a license and self-serve a free trial), and every other service (which enforces the resulting entitlements).

1. Identity

PropertyValue
Module IDCORE-15
TierCore
StatusBuilt
PhaseP1 (Plans + Licenses + Validation), P2 (Activation + Free Trial + Certificate distribution)
PriorityHIGH
Primary usersPlatform Operator · Merchant Owner · Other services (entitlement enforcement)

2. Purpose & Scope

IncludedExcluded
Reusable plans: trial, subscription, perpetualBilling, invoicing, and dunning
Typed feature flags and seat quotas per planPayment / subscription-charge integration
Public plan catalog for sign-up surfacesUsage metering and heartbeat tracking
License issuance, renew, suspend, reinstate, revokePer-feature runtime enforcement (each consuming service does its own)
Self-service free-trial issuanceLicense management UI (frontend concern)
Device activation (fingerprint binding, seat limit)Certificate verification (done by every other service offline)
Runtime validation returning a signed certificateEager expiry sweeping (expiry is lazy, on validation)
Per-license overrides of plan defaults
Append-only license event audit log

3. Capabilities

CapabilityWhat the user can do
Plan managementDefine reusable plans (trial / subscription / perpetual) with duration, grace period, and seat limit
Feature flags & quotasAttach typed flags (boolean / number / text / json) to a plan to switch features on/off and set numeric quotas
Plan catalogExpose the list of active plans, with their features, to sign-up and upgrade surfaces
License issuanceIssue a license from a plan, bound to a merchant or user, with a unique license key
License lifecycleRenew, suspend, reinstate, and revoke a license, each audited and re-certified
Free trialA merchant self-serves a single free-trial license without operator action
Device activationBind a license to specific devices by fingerprint, capped by the plan's seat limit
Runtime validationValidate a license key and receive its status, resolved features, and a signed certificate
Per-license overrideOverride a plan's seat limit or feature values for one specific license
Audit trailEvery lifecycle action is recorded in an append-only event log

4. Module Dependencies

Depends onWhy
CommerceA license is bound to a merchant (or user) principal; merchant identity comes from Commerce
PermissionsPlan and license management actions are gated by licensing-scoped permissions
Sale / Inventory / other modulesConsume the signed certificate to gate features and seat quotas; Licensing gates their access

5. Backend Packages

Implementation detail lives in the developer docs - this section only maps the module to the service that powers it.

PackageRoleDeveloper docs
@nx/licensingOwns the entire licensing domain: plans, feature flags, license lifecycle, activation, validation, and certificate signinglicensing

Licensing owns no schema of its own - all five tables (Policy, PolicyFeature, License, Activation, LicenseEvent) live in @nx/core and are re-exported. The package signs an Ed25519 certificate and caches it; every other service verifies that certificate offline.

Engineering Mapping (Feature ⇄ Package)

The horizontal axis of the Feature Spine - each business feature (<AREA> in the URD) maps to its engineering home. Reciprocal: the package docs link back here.

FeatureDev packageStatus
PLN Plans & Feature Flags@nx/licensingBuilt
LIC License Lifecycle@nx/licensingBuilt
VAL Runtime Validation & Entitlements@nx/licensingBuilt
ACT Device Activation@nx/licensingBuilt

6. Key User Flows

7. Roles & Permissions

RoleCanCannot
Platform OperatorManage plans and feature flags; issue, renew, suspend, reinstate, revoke licenses; manage activations-
Merchant OwnerBrowse the plan catalog; self-serve one free trial; validate their own licenseManage plans; issue or revoke licenses for others
Other servicesValidate a license key and read the resulting certificateMutate plans, licenses, or activations

8. Status & Roadmap

Module status: Built. The backend (@nx/licensing) ships five controllers and three services covering the full plan → license → activation → validation flow, with Ed25519-signed certificates distributed via cache.

PhaseCapabilities
P1Plans (trial / subscription / perpetual), typed feature flags + seat limits, plan catalog, license issuance + lifecycle (renew/suspend/reinstate/revoke), runtime validation, event audit log
P2Self-service free trial, device activation with seat enforcement, per-license override, Ed25519 certificate signing + offline verification across services
P3Eager expiry sweeping, license-event REST surface, calendar-aware durations, usage metering (all planned, not built)

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.