Skip to main content
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:
  1. Calls POST /api/public/auth/checkout-token with the tenant’s public key
  2. Receives a signed JWT token
  3. 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).
  1. Calls POST /api/public/auth/portal-token
  2. Redirects to {portalUrl}/billing?token={jwt}