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

hasTierAccess

hasTierAccess(tierId: string): Promise<boolean> Returns true when the current user has access through the requested tier. The check covers active lifetime purchases and current recurring plans, including trials and past_due subscriptions whose billing period has not ended.
Use the tier ID shown in your dashboard. This method returns false when the user is signed out. Use getUser() when you also need user or plan details.

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.