Subscription State

Customer entitlements in tiun surface through the signed-in user record. The field that drives “who can see what” in your app is productAccess.

What productAccess contains

productAccess is an array of product IDs—strings such as p-live-pro or staging IDs like p-test-abc0123. It represents products the user currently has active access to through their subscriptions, as modeled in your dashboard.

The list is filled after a successful checkout and when tiun restores the session—for example on a userChange event with event: 'init' after the page loads. Use it to gate features, routes, or content by comparing against the product IDs you configured for each plan or SKU.

Checking access in code

Subscribe to userChange and derive access from the payload to keep your UI in sync:

tiun.on('userChange', (data) => {
  if (data.isAuthenticated) {
    const hasPro = data.user.productAccess.includes('p-live-pro');
    const hasLight = data.user.productAccess.includes('p-live-light');
  }
});

Replace the example IDs with the product IDs from your tiun.business dashboardarrow-up-right.

UserInfo fields

Field
Type
Role

userId

string

Stable identifier for the user in tiun

email

string

Email on the account

productAccess

string[]

Product IDs the user can access right now

circle-info

If your UI does not update when you expect, confirm you are handling userChange — it is the primary mechanism for keeping your app aligned with entitlement changes.

Last updated

Was this helpful?