Skip to main content
When a method throws, compare error.name against the string values documented in Error handling.

getUser

getUser(): Promise<User | null> Retrieves info about the current user. Returns null if the user is not logged in.
Returns

getTiers

getTiers(): Promise<Tier[]> Fetches all available tiers and their prices. You can call this before the user logs in, which is useful when your extension shows its own plans or pricing screen.
Returns

openPricingPage

openPricingPage(asPopup?: boolean): void Opens a page showing available subscription plans.

openCheckoutPage

openCheckoutPage(priceId: string, asPopup?: boolean): void Opens the checkout page directly for a specific price. This is useful if you prefer to build your own custom plans UI in your extension (by using the getTiers method) and link directly to checkout, instead of using the crxbase pricing page.

openManagePage

openManagePage(asPopup?: boolean): void Opens Stripe Portal to allow the user to manage their subscriptions.
It is important you include a easy way to open this page inside your extension!

openLoginPage

openLoginPage(asPopup?: boolean): void Opens a page for the user to log in.

logout

logout(): Promise<void> Logs the current user out by clearing their authentication session.