Skip to Content
SdkReactInternalType AliasesUseSubscriptionResult

UseSubscriptionResult

UseSubscriptionResult = object

Defined in: src/react/useSubscription.ts:40 

Properties

cancelSubscription()

cancelSubscription: () => Promise<HandlersCancelSubscriptionResponse | null>

Defined in: src/react/useSubscription.ts:76 

Cancel the subscription at the end of the current period

Returns

Promise<HandlersCancelSubscriptionResponse | null>

The cancellation response or null on error


createCheckoutSession()

createCheckoutSession: (options?: object) => Promise<string | null>

Defined in: src/react/useSubscription.ts:61 

Create a Stripe checkout session for upgrading to Pro

Parameters

ParameterType

options?

object

options.cancelUrl?

string

options.successUrl?

string

Returns

Promise<string | null>

The checkout URL or null on error


error

error: Error | null

Defined in: src/react/useSubscription.ts:52 

Error from the last operation


isLoading

isLoading: boolean

Defined in: src/react/useSubscription.ts:48 

Whether any operation is in progress


openCustomerPortal()

openCustomerPortal: (options?: object) => Promise<string | null>

Defined in: src/react/useSubscription.ts:69 

Open the Stripe customer portal for managing billing

Parameters

ParameterType

options?

object

options.returnUrl?

string

Returns

Promise<string | null>

The portal URL or null on error


refetch()

refetch: () => Promise<void>

Defined in: src/react/useSubscription.ts:56 

Refetch the subscription status

Returns

Promise<void>


renewSubscription()

renewSubscription: () => Promise<HandlersRenewSubscriptionResponse | null>

Defined in: src/react/useSubscription.ts:81 

Reactivate a cancelled subscription

Returns

Promise<HandlersRenewSubscriptionResponse | null>

The renewal response or null on error


status

status: HandlersSubscriptionStatusResponse | null

Defined in: src/react/useSubscription.ts:44 

Current subscription status

Last updated on