Create a session on your server
CallPOST /sdk/session from your backend with your private API key in the Authorization header.
clientToken and its lifetime in seconds:
Pass the token to the browser
DeliverclientToken to your front-end. Common approaches include:
- Inline JSON — embed it in your HTML template when the page is server-rendered.
- API response — return it from a lightweight
/api/checkout-sessionendpoint that your SPA calls on page load.
new TheriusSDK({ clientToken }).
Optional request parameters
Merchant-managed subscriptions
If you run your own recurring billing outside the Therius Subscriptions API — for example, a one-time checkout that should establish a card-on-file mandate you bill against yourself later — passcardOnFile when creating the session, instead of configuring anything in the Checkout Builder:
cardOnFile is set:
- The Checkout Widget skips the optional “save my card” checkbox entirely and shows a fixed disclosure (“Your card will be saved for future charges”) instead — there is nothing for the shopper to opt into, since you already declared the intent server-side.
- The resulting charge is tokenized and tagged with the given stored-credential fields (
usage/initiatedBy/type, see Stored Credentials) unconditionally, regardless of anything the browser sends — the signed session token is the source of truth, not the request body. customerIdis required — there must be a shopper to attribute the saved card to.
cardOnFile, the session behaves exactly as before: the checkout follows whatever the Checkout Builder’s “save my card” (vault-consent) setting says, and any resulting saved card is a plain card-on-file, not a recurring mandate.
There used to be a separate “Starts a merchant-managed subscription” checkbox in the Checkout Builder. It has been removed — this is now a per-transaction, server-controlled setting instead of a static per-checkout-config flag, so a shopper can never see (or suppress) the wrong consent state for a given session.
Initialize the SDK in the browser
Once the browser has the token, initialize the SDK:TheriusSDK throws synchronously.

