Entitlements Overview
A complete, enterprise-grade entitlements engine that transforms your platform into a differentiated SaaS product with editions, subscriptions, and per-tenant feature control.
Stop hardcoding plan checks into your codebase. SCRIPE's Entitlements module provides a full-stack, API-level feature gating engine that automatically enforces what each tenant can and cannot do — based on their subscribed edition, active overrides, and real-time quota counters.
Why Built-In Entitlements?
Most SaaS platforms bolt on feature flags as an afterthought. SCRIPE integrates entitlements directly into the CQRS pipeline via the IRequireFeature interface, meaning every command can be automatically gated without a single line of custom middleware.
Editions (Plans)
Named feature bundles like Basic, Pro, Enterprise that define what each plan includes.
Subscription Lifecycle
Assign, upgrade, downgrade, suspend, and renew tenant subscriptions with full audit trails.
Feature Catalog
Boolean, Numeric, and String feature types with system-seeded defaults and custom extensibility.
Per-Tenant Overrides
Customize any feature value for individual tenants — perfect for enterprise deals or beta access.
Quota Enforcement
Numeric features with QuotaCounter entities are automatically enforced at the pipeline level.
Version & Rollout
Deploy edition changes via immediate, canary, or scheduled rollout strategies.
How It Works
Every API command that implements IRequireFeature is intercepted by the FeatureCheckBehavior pipeline. The system resolves the tenant's effective feature values (overrides → edition → defaults) and either allows execution or returns a clear 'feature disabled' response.
Resolution Priority
When the system resolves a feature value for a tenant, it checks sources in strict priority order. The first source that provides a value wins.
| Priority | Source | Use Case |
|---|---|---|
| 1 (Highest) | Tenant Override | Custom enterprise deals, promotions, beta testing |
| 2 | Active Subscription → Edition | Standard plan-based feature access |
| 3 | Add-on Subscriptions | Optional feature packs purchased separately |
| 4 (Lowest) | Feature Default Value | Fallback when no other source applies |
Business Value
| Challenge | Without SCRIPE | With SCRIPE Entitlements |
|---|---|---|
| Plan differentiation | Hardcoded if/else checks scattered everywhere | Automatic pipeline-level gating per edition |
| Enterprise custom deals | Code deployments for each special case | Per-tenant overrides via API in seconds |
| Usage limits | Manual counting and validation | Automatic QuotaCounter enforcement |
| Plan changes | Risky database migrations | Real-time upgrade/downgrade with impact analysis |
| Feature rollouts | Big-bang deployments risking all tenants | Canary and scheduled rollout strategies |