MCPcopy Index your code
hub / github.com/RevenueCat/purchases-capacitor

github.com/RevenueCat/purchases-capacitor @13.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 13.2.1 ↗ · + Follow
574 symbols 1,118 edges 45 files 82 documented · 14% updated 5d ago13.2.1 · 2026-07-02★ 23115 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

😻 In-App Subscriptions Made Easy 😻

License Release

RevenueCat is a powerful, reliable, and free to use in-app purchase server with cross-platform support. Our open-source framework provides a backend and a wrapper around StoreKit and Google Play Billing to make implementing in-app purchases and subscriptions easy.

Whether you are building a new app or already have millions of customers, you can use RevenueCat to:

  • Fetch products, make purchases, and check subscription status with our native SDKs.
  • Host and configure products remotely from our dashboard.
  • Analyze the most important metrics for your app business in one place.
  • See customer transaction histories, chart lifetime value, and grant promotional subscriptions.
  • Get notified of real-time events through webhooks.
  • Send enriched purchase events to analytics and attribution tools with our easy integrations.

Sign up to get started for free.

@revenuecat/purchases-capacitor

@revenuecat/purchases-capacitor is the client for the RevenueCat subscription and purchase tracking system. It is an open source framework that provides a wrapper around StoreKit, Google Play Billing and the RevenueCat backend to make implementing in-app purchases in Capacitor easy.

RevenueCat SDK Features

RevenueCat
Server-side receipt validation
➡️ Webhooks - enhanced server-to-server communication with events for purchases, renewals, cancellations, and more
🎯 Subscription status tracking - know whether a user is subscribed whether they're on iOS, Android or web
📊 Analytics - automatic calculation of metrics like conversion, mrr, and churn
📝 Online documentation up to date
🔀 Integrations - over a dozen integrations to easily send purchase data where you need it
💯 Well maintained - frequent releases
📮 Great support - Help Center

Getting Started

For more detailed information, you can view our complete documentation at docs.revenuecat.com.

Please follow the Quickstart Guide for more information on how to install the SDK.

npm install @revenuecat/purchases-capacitor
npx cap sync

Contributing

Contributions are always welcome! To learn how you can contribute, please see the Contributing Guide.

Acknowledgment

This plugin is based on CapGo's Capacitor plugin. The plugin was transferred to RevenueCat to become an officially supported plugin.

API

configure(...)

configure(configuration: PurchasesConfiguration) => Promise<void>

Sets up Purchases with your API key and an app user id.

Param Type Description
configuration PurchasesConfiguration RevenueCat configuration object including the API key and other optional parameters. See {@link PurchasesConfiguration}

getVirtualCurrencies()

getVirtualCurrencies() => Promise<{ virtualCurrencies: PurchasesVirtualCurrencies; }>

Fetches the virtual currencies for the current subscriber.

Returns: Promise<{ virtualCurrencies: PurchasesVirtualCurrencies; }>


invalidateVirtualCurrenciesCache()

invalidateVirtualCurrenciesCache() => Promise<void>

Invalidates the cache for virtual currencies.

This is useful for cases where a virtual currency's balance might have been updated outside of the app, like if you decreased a user's balance from the user spending a virtual currency, or if you increased the balance from your backend using the server APIs.


getCachedVirtualCurrencies()

getCachedVirtualCurrencies() => Promise<{ cachedVirtualCurrencies: PurchasesVirtualCurrencies | null; }>

The currently cached {@link PurchasesVirtualCurrencies} if one is available. This value will remain null until virtual currencies have been fetched at least once with {@link getVirtualCurrencies} or an equivalent function.

Returns: Promise<{ cachedVirtualCurrencies: PurchasesVirtualCurrencies | null; }>


parseAsWebPurchaseRedemption(...)

parseAsWebPurchaseRedemption(options: { urlString: string; }) => Promise<{ webPurchaseRedemption: WebPurchaseRedemption | null; }>

Parses the given URL string into a [WebPurchaseRedemption] object that can be used to redeem web purchases.

Param Type Description
options { urlString: string; } Set the urlString used to open the App.

Returns: Promise<{ webPurchaseRedemption: WebPurchaseRedemption | null; }>


redeemWebPurchase(...)

redeemWebPurchase(options: { webPurchaseRedemption: WebPurchaseRedemption; }) => Promise<WebPurchaseRedemptionResult>

Redeems the web purchase associated with the Redemption Link obtained with [parseAsWebPurchaseRedemption].

Param Type Description
options { webPurchaseRedemption: WebPurchaseRedemption; } The WebPurchaseRedemption object obtained from {@link parseAsWebPurchaseRedemption}.

Returns: Promise<WebPurchaseRedemptionResult>


setMockWebResults(...)

setMockWebResults(options: { shouldMockWebResults: boolean; }) => Promise<void>

Sets whether the SDK should return mocked results in the web version. This won't affect the iOS and Android versions of the implementation. Default is false

Param Type Description
options { shouldMockWebResults: boolean; } Set shouldMockWebResults to true if you want the plugin methods to return mocked values

setSimulatesAskToBuyInSandbox(...)

setSimulatesAskToBuyInSandbox(options: { simulatesAskToBuyInSandbox: boolean; }) => Promise<void>

iOS only.

Param Type Description
options { simulatesAskToBuyInSandbox

Extension points exported contracts — how you extend this code

PurchasesPlugin (Interface)
(no doc) [3 implementers]
src/definitions.ts
RevenueCatUINativePlugin (Interface)
* Internal native plugin interface with native-only methods and events. * This is not exported to consumers. [1 implementers]
purchases-capacitor-ui/src/index.ts
LaunchArgsPlugin (Interface)
(no doc) [1 implementers]
e2e-tests/MaestroTestApp/src/app.ts
ContainerProps (Interface)
(no doc)
example/purchase-tester/src/components/FunctionTesterContainer.tsx
GetProductOptions (Interface)
(no doc)
src/definitions.ts
RevenueCatUIPlugin (Interface)
(no doc) [2 implementers]
purchases-capacitor-ui/src/definitions.ts
TestCase (Interface)
(no doc)
e2e-tests/MaestroTestApp/src/test_cases.ts
CustomVariablesEditorProps (Interface)
(no doc)
example/purchase-tester/src/components/CustomVariablesEditor.tsx

Core symbols most depended-on inside this repo

updateLastFunction
called by 68
example/purchase-tester/src/components/FunctionTesterContainer.tsx
mockNonReturningFunctionIfEnabled
called by 37
src/web.ts
mockReturningFunctionIfEnabled
called by 36
src/web.ts
updateLastFunctionWithoutContent
called by 33
example/purchase-tester/src/components/FunctionTesterContainer.tsx
refreshCustomerInfo
called by 20
example/purchase-tester/src/components/FunctionTesterContainer.tsx
presentPaywall
called by 20
purchases-capacitor-ui/src/index.ts
getStringOrReject
called by 15
android/src/main/java/com/revenuecat/purchases/capacitor/PurchasesPlugin.kt
addListener
called by 15
purchases-capacitor-ui/src/index.ts

Shape

Method 292
Function 244
Interface 27
Class 10
Enum 1

Languages

TypeScript79%
Kotlin20%
Java1%

Modules by API surface

android/src/main/java/com/revenuecat/purchases/capacitor/PurchasesPlugin.kt94 symbols
src/definitions.ts86 symbols
example/purchase-tester/src/components/FunctionTesterContainer.tsx86 symbols
src/web.ts79 symbols
apitesters/src/purchases.ts29 symbols
purchases-capacitor-ui/android/src/main/java/com/revenuecat/purchases/capacitor/ui/RevenueCatUIPlugin.kt22 symbols
apitesters/src/offerings.ts22 symbols
purchases-capacitor-ui/src/index.ts20 symbols
apitesters/src/enums.ts19 symbols
purchases-capacitor-ui/src/definitions.ts16 symbols
purchases-capacitor-ui/src/web.ts14 symbols
apitesters/src/definitions.ts14 symbols

For agents

$ claude mcp add purchases-capacitor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page