Skip to main content

Entitlement checks

Stigg supports three types of feature entitlements: boolean (on/off), numeric (configuration values), and metered (usage-tracked with limits). A unified method to check any type of feature entitlement. It automatically returns the appropriate entitlement type based on the feature configuration. You provide the customer ID and feature ID. Optionally, pass a resource ID for multi-subscription products, or a requested usage amount to proactively check if additional usage would be allowed (metered features only).

Soft-limit credit entitlements

For credit entitlements configured with a soft limit, getEntitlement returns hasAccess: true and hasSoftLimit: true even after the credit balance reaches zero. This lets your application distinguish between:
  • Hard limit exhaustedhasAccess: false (block the action)
  • Soft limit exceededhasAccess: true, hasSoftLimit: true (allow but track overage)
Node.js
Credit-backed features (features that consume credits) inherit the wallet’s soft-limit, so their getEntitlement responses return the same hasSoftLimit signal as the underlying credit entitlement.

Boolean entitlement check

Check whether a customer has access to a boolean (on/off) feature.

Numeric entitlement check

Retrieve the numeric value configured for a feature (e.g., max file size, API rate limit).

Metered entitlement check

Check whether a customer’s usage of a metered feature is within the allowed quota. You can optionally provide a requested usage amount to proactively verify if a specific amount of additional usage would be allowed before performing the action.

Getting all entitlements

Retrieve all entitlements for a customer (or a specific resource), returning the full list of features they have access to along with usage limits and current usage.