Sessions
Time-based billing is built around billing sessions, not identified users. When the customer connects a payment method, tiun opens a session and starts metering against your product's interval and fee. The session — not an email or userId — is the unit of "is this person currently allowed to use paid content?"
What tiun captures
When you call tiun.start(), the customer connects a payment method — credit/debit cards, PayPal, Apple Pay, Google Pay, PrePaid (tiun credits), or Twint — and tiun creates a billing session tied to that connection.
Behind the scenes, tiun extracts and stores details about the customer and their session. You can review this data under User Management in the my.tiun.business dashboard, but it is not exposed to the SDK or your snippet. From your app's perspective, sessions are anonymous.
That's a deliberate design choice: in time-based experiences (news, podcasts, streaming), the integration only needs to know whether the customer currently has access — not who they are. Identity-bound flows like login/logout and productAccess do not apply here.
Session lifecycle
A session moves through three states:
Locked
No active billing session, or the session is not granting access. The user should see a paywall.
Active
Billing session is in progress; eligible content is billable and time accrues per your product rules.
Ended / Invalid
The session was closed or payment failed. No further billing for this visit; the user returns to Locked and may need to start again.
Transitions are signaled to your app via paywall events: paywallHide corresponds to entering Active, paywallShow corresponds to leaving it.
Session ID
When paywallHide fires (the session is Active and the user has access), the payload includes a sessionId. The session ID is what your backend uses to verify the session server-side before serving premium content — protecting your APIs against clients that fake or spoof access on the front end.
For the verification flow including the API endpoint and example backend code, see server-side session verification.
Last updated
Was this helpful?