Access Model

Entitlements in tiun depend on which product type you use. Subscriptions expose granular, product-level rights through the user record. Time-based billing exposes binary access — paid session active or not — through events.


Subscription access

For subscriptions, the productAccess array on the user object is the source of truth. It lists product IDs the customer is allowed to use. Your application should gate features and content by checking whether the relevant product ID appears in that array.

When the user state or user session changes, tiun emits userChange. Subscribe to that event to keep navigation, paywalls, and premium areas aligned with current entitlements.

tiun.on('userChange', (data) => {
  if (data.user?.productAccess.includes('p-live-pro')) {
    renderProExperience();
  }
});

Time-based access

Access is tied to the billing session and surfaced through paywall events:

Event
Meaning

paywallHide

The user may use paid content (session allows billing / access).

paywallShow

The user should not see paid content (no access or billing paused as defined by your integration).

Your UI reacts to these events to show or hide premium experiences.

tiun.on('paywallHide', () => {
  showPremiumContent();
});

Key difference

Subscriptions give you granular entitlements: multiple products, tiers, and explicit checks per product ID via productAccess and userChange.

Time-based billing gives you binary access at the session level: integrate with paywall show/hide and content signals rather than scanning a list of purchased product IDs.

Last updated

Was this helpful?