Owostack
Concepts

Entitlements & features

How Owostack models permissions, limits, and feature values

Entitlements & features

In Owostack, features are the capabilities in your product and entitlements are the rules that grant those capabilities to a customer.

Feature types

  • boolean
    • On/off access
  • metered
    • A limit that can be checked and incremented (usage)
  • static
    • A fixed value (configuration)

Where entitlements come from

  • A customer’s active subscription plan
  • Optional customer-level overrides

Runtime access checks

Use check() to decide whether to allow an action.

const { allowed, code, balance } = await owo.check({
  customer: "user_123",
  feature: "api_calls_monthly",
});
  • allowed is the main signal you should gate on.
  • balance is useful for UX (show usage).
  • code helps you decide why access was denied (upgrade, top-up, etc.).

Response codes

  • access_granted — the customer has access
  • limit_exceeded — usage limit has been reached
  • feature_not_in_plan — the feature is not available on the current plan
  • no_active_subscription — the customer has no active subscription

Usage tracking

If a feature is metered, call track() to record usage.

await owo.track({
  customer: "user_123",
  feature: "api_calls_monthly",
  value: 1,
});

Overrides

Owostack allows you to override entitlements at the customer level. You can grant specific features to a customer regardless of their plan — useful for grandfathering early users or giving beta access.

On this page