@elapse/react does the rest in place. Nobody is sent to a page Elapse hosts, and you never hold a card, a wallet or a balance.
Creating a session
max_duration_seconds caps how long one subscription can run and therefore how much the subscriber is asked to fund: rate × cap, shown to them as a dollar amount before they authorise. When the cap is reached the meter stops on its own.
success_url is a security boundary, not a redirect. Its origin is the only one Elapse will post a signature result back to, so it must be your app’s origin. cancel_url is where a subscriber who backs out is sent from their own account page.
What the subscriber does
In your page, not ours:<Authorize>shows how long the meter may run and the most it can cost — unless you passcap, in which case you have chosen it and the step is skipped.- Face ID, in a window Elapse opens on its own origin. Your code never touches the subscriber’s wallet.
<Meter>ticks the seconds and the dollars, offers the controls the Product allows, and turns into the receipt when the meter stops.
Granting access
Grant access whensubscription.created arrives at your webhook endpoint — and for a merchant-started Product, when subscription.updated says active. Revoke it on subscription.canceled. Never grant from something the browser told you; a callback in a page can be forged, a signed webhook cannot. The Quickstart handler does exactly that with an in-memory map keyed by subscription id.
Session states
A session is single-use. Create one per visit, not one per product.
The promise
Whatever happens on the chain underneath, the subscriber only ever sees seconds and dollars. The one exception is opt-in:<Meter proof> shows the transaction that started the meter and the one that ended it, for merchants whose audience wants to verify. Your integration never has to mention it.