Handles redirects to the Crovver checkout flow and billing portal. Internally calls the Crovver API to generate a short-lived JWT, then redirects the user.
Usage
Return Value
isRedirecting is currently always false. Do not rely on it to show a loading state — both redirect functions trigger a full page navigation, so the component unmounts before any state update would take effect.
redirectToCheckout(options?)
Redirects the user to the Crovver pricing/checkout page. Internally:
- Calls
POST /api/public/auth/checkout-token with the tenant’s public key
- Receives a signed JWT token
- Redirects to
{ecomUrl}/pricing?token={jwt}
Options
Examples
redirectToBilling()
Redirects the user to the billing portal to manage their subscription (view invoices, update payment method, cancel).
- Calls
POST /api/public/auth/portal-token
- Redirects to
{portalUrl}/billing?token={jwt}