Skip to content

tier-engine

Stores a tier-assignment entity per tenant (which pricing tier is active) and, when configured with a TierMap, registers itself as the tenantTierResolver extension so the dispatcher automatically gates r.toggleable() features per tenant based on their assigned tier. Call createTierEngineFeature({ defaultTier, tierMap }) to get full tier composition — including an inTransaction entity hook that atomically writes the default tier when a new tenant is created — or use createTierEngineFeature() without options for storage-only mode when you manage tier assignment yourself via composeApp. A SystemAdmin-only set-tenant-tier write plus get-tenant-tier/tier-options reads let an operator assign a tier to ANY tenant manually — without a billing purchase — stamping source: "manual" so a future Stripe→tier sync won’t overwrite the grant. Apps surface this via the tier-admin screen.

  • Requires: config, tenant
  • Activation: always on (not toggleable)