SDK

Capacitor and Ionic in-app purchases with the RevenueDot plugin

To add in-app purchases to a Capacitor or Ionic app, install the RevenueDot plugin from npm under the name @revenuecat/purchases-capacitor, run npx cap sync and call Purchases.configure with your app's appl_ or goog_ key. RevenueDot checks each purchase with the App Store or Google Play and keeps each customer's access in sync. RevenueDot Cloud is free until your app makes $10,000 a month.

Free until your app makes $10,000 a month. Switching from RevenueCat? Change one line.

One npm install

An npm alias installs @revenuedot/purchases-capacitor 13.6.1, so Capacitor's native names stay the same.

iOS and Android

One TypeScript API covers both native platforms. The plugin has no web implementation.

Build checked

Installed from npm, it builds into a Capacitor 8 iOS app that carries api.revenuedot.app and no RevenueCat host.

Test Store first

Buy with a test_ key in a debug build before you have App Store or Google Play accounts.

Steps

How to add subscriptions to a Capacitor app with RevenueDot

  1. 01

    Create a free Cloud project

    Start for free on RevenueDot Cloud and add an App Store app and a Google Play app, or a Test Store app for a first run.

  2. 02

    Connect the stores and create the catalog

    Add credentials (App Store, Google Play), then products, an entitlement such as pro (the access your app checks) and a current offering (the products your paywall shows).

  3. 03

    Install the RevenueDot plugin and configure it with your key

    Install the plugin through the npm alias below, run npx cap sync, then call Purchases.configure with the appl_ or goog_ key. On Cloud the plugin already points at RevenueDot, so your key is the only setting.

  4. 04

    Buy and check the entitlement

    Call Purchases.purchasePackage({ aPackage }) and read customerInfo.entitlements.active["pro"].

  5. 05

    Test with a Test Store key

    Use a test_ key in a debug build to buy with no store account. See the Test Store.

Install

Install the RevenueDot Capacitor plugin and configure it with your key

The RevenueDot plugin is built from RevenueCat's open-source plugin (MIT license). The alias installs it under the name @revenuecat/purchases-capacitor, because Capacitor derives native pod and Swift package names from the npm name. Your code calls Purchases, every request goes to RevenueDot, and you need no RevenueCat account.

For paywalls, add @revenuecat/purchases-capacitor-ui@npm:@revenuedot/purchases-capacitor-ui@13.6.1 the same way.

Self-hosting? Await Purchases.setProxyURL({ url }) with your server's URL before configure, and pass entitlementVerificationMode: ENTITLEMENT_VERIFICATION_MODE.DISABLED, because your server signs with its own key. See Trusted Entitlements.

Install, then configure at app startTerminal and TypeScript
npm install @revenuecat/purchases-capacitor@npm:@revenuedot/purchases-capacitor@13.6.1
npx cap sync

// App start
import { Capacitor } from "@capacitor/core";
import { Purchases } from "@revenuecat/purchases-capacitor";

await Purchases.configure({ apiKey: Capacitor.getPlatform() === "ios" ? "appl_..." : "goog_..." });

TypeScript

Check the entitlement, then buy a package

getCustomerInfo resolves to { customerInfo }, and purchasePackage takes { aPackage }.

Check access and buyTypeScript
const { customerInfo } = await Purchases.getCustomerInfo();
const isPro = customerInfo.entitlements.active["pro"] !== undefined;

const offerings = await Purchases.getOfferings();
const aPackage = offerings.current?.availablePackages[0];
if (aPackage) {
  const result = await Purchases.purchasePackage({ aPackage });
  const nowPro = result.customerInfo.entitlements.active["pro"] !== undefined;
}

Notes

Check these Capacitor details before you ship

  • Test Store keys work in debug builds only. Ship with appl_ and goog_ keys.
  • Install through the alias only: a direct install of @revenuedot/purchases-capacitor would change the generated native names and is not supported.
  • Status: there is no Capacitor example app yet. The React Native example shows the same calls in JavaScript.

Switch

Switching from RevenueCat? Keep the Capacitor plugin and change one line

If your app already ships RevenueCat's @revenuecat/purchases-capacitor, you can keep it. Await Purchases.setProxyURL({ url }) before configure, and pass verification DISABLED. Then call Purchases.syncPurchases() once on the first launch of the update, so current subscribers keep access. The full plan is in Migrate from RevenueCat.

  • Object argument: setProxyURL takes { url }, not a plain string.
  • Verification: the plugin passes no default, so the native informational mode would log every RevenueDot response as a failed check. Pass DISABLED. Never use ENFORCED: every request would fail.
  • Keys: the importer keeps your RevenueCat appl_ and goog_ keys working, so builds you already shipped keep their keys.
Point the RevenueCat plugin at RevenueDotTypeScript
import { Capacitor } from "@capacitor/core";
import { ENTITLEMENT_VERIFICATION_MODE, Purchases } from "@revenuecat/purchases-capacitor";

await Purchases.setProxyURL({ url: "https://api.revenuedot.app" });
await Purchases.configure({
  apiKey: Capacitor.getPlatform() === "ios" ? "appl_..." : "goog_...",
  entitlementVerificationMode: ENTITLEMENT_VERIFICATION_MODE.DISABLED,
});

// Once, on the first launch of this update
await Purchases.syncPurchases();

FAQ

Capacitor and Ionic: questions people ask

Do I need a RevenueCat account to use the RevenueDot Capacitor plugin?

No. The RevenueDot plugin is built from RevenueCat's open-source Capacitor plugin under the MIT license, but every request goes to RevenueDot. Create a free RevenueDot Cloud project, copy your app's keys and pass them to Purchases.configure.

How do I add in-app purchases to a Capacitor or Ionic app?

Install the RevenueDot plugin through the npm alias, run npx cap sync, configure it with your appl_ or goog_ key, fetch offerings and call purchasePackage. RevenueDot checks each purchase with the store and keeps the customer's entitlements in sync.

Why does the install use the name @revenuecat/purchases-capacitor?

Capacitor derives native pod and Swift package names from the npm package name. The alias installs @revenuedot/purchases-capacitor under the original name, so those native names stay the same. A direct install is not supported.

Does the Capacitor plugin work on the web?

No. The plugin has no web implementation, like the open-source plugin it is built from. For web sales, use the RevenueDot web SDK or a purchase link with Stripe Checkout.

I already ship RevenueCat's Capacitor plugin. What changes?

Await Purchases.setProxyURL({ url: "https://api.revenuedot.app" }) before configure, pass entitlementVerificationMode DISABLED and call syncPurchases once after the update. The plugin passes no verification default, so without DISABLED every response is logged as a failed check.

Get started

Start selling subscriptions in your app today.

Building and testing are free, and you can test your first purchase before you have a store account. Pro costs $0 until your apps make $10,000 a month.

Already have an account? Sign in · Switching from RevenueCat? Change one line