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

How it works

Time-based billing charges customers for actual time they spend with billable content rather than a flat membership fee. It fits streaming, reading, and listening experiences where value scales with engagement.


The core flow

The mental model is four steps:

  1. The user connects a payment method through tiun.start() on your paywall.

  2. tiun starts a billing session and begins metering time against your configured interval and price.

  3. The user is billed for time spent according to the product's interval fee and optional monthly cap.

  4. The session ends when the user leaves, your app stops billable content, or payment fails — access returns to the locked state.

You configure the product itself in the dashboard (interval, fee, monthly limit — see Products). The SDK and events connect that configuration to your app's UI and routing.


Where the details live

The rest of the time-based reference is split across three pages, each owning one piece of the model:

  • Sessions — the session lifecycle (Locked / Active / Ended), what tiun tracks behind the scenes, and the sessionId you can verify server-side.

  • Access — the paywallShow and paywallHide events that tell your app when the user has access.

  • Protecting content — how to gate the UI with paywall events and how to use tiun.setContent() to control metering as the user navigates.

For an end-to-end walkthrough, see charging for time-based sessions.

Last updated

Was this helpful?