For the complete documentation index, see llms.txt. This page is also available as Markdown.

Access

Time-based access is binary at the session level — at any moment a user either has access or they don't. tiun signals this to your app through two events: paywallShow and paywallHide.


Paywall events

Event
Meaning

paywallShow

The user should not see paid content. Either there's no active session, the session ended, payment failed, or your integration has explicitly paused access. Render the paywall or locked state.

paywallHide

The user has access. The billing session is Active. Reveal premium UI.

These map directly to session state — see Sessions for the Locked / Active / Ended lifecycle. paywallHide corresponds to entering Active; paywallShow corresponds to leaving it.


What the paywallHide payload includes

When access is granted, the paywallHide event payload includes a sessionId. Use it when you need to verify the session on your backend before serving premium content — see server-side session verification.

tiun.on('paywallHide', (data) => {
  console.log('Session is active:', data.sessionId);
  showPremiumContent();
});

tiun.on('paywallShow', () => {
  hidePremiumContent();
  showPaywall();
});

Where to go next

Last updated

Was this helpful?