Skip to Content
Anuma SDKReactHooksuseSubscription

useSubscription

useSubscription(options: object): UseSubscriptionResult

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

React hook for managing subscription status and billing operations. Provides methods to check status, upgrade, manage billing, cancel, and renew subscriptions.

Parameters

ParameterTypeDescription

options

object

‐

options.autoFetch?

boolean

Whether to fetch subscription status automatically on mount (default: true)

options.baseUrl?

string

Optional base URL for the API requests.

options.getToken?

() => Promise<string | null>

Custom function to get auth token for API calls

options.onError?

(error: Error) => void

Optional callback for error handling

Returns

UseSubscriptionResult

Last updated on