SDK

Cordova in-app purchases and subscriptions with the RevenueDot plugin

To add in-app purchases to a Cordova app, run cordova plugin add @revenuedot/cordova-plugin-purchases and call Purchases.configureWith with your app's appl_ or goog_ key on deviceready. RevenueDot checks each purchase with the App Store or Google Play and keeps each customer's access in sync. The plugin id and the global Purchases match the open-source plugin it is built from. Cloud is free until $10,000 a month.

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

One plugin

@revenuedot/cordova-plugin-purchases 8.2.3 is on npm, with its native dependencies on CocoaPods and Maven Central.

Clean signature checks on Cloud

The plugin trusts RevenueDot's signing key, so RevenueDot Cloud's responses verify.

Familiar names

The plugin id is cordova-plugin-purchases and your code calls the global Purchases.

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 Cordova 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

    Run cordova plugin add, then call Purchases.configureWith inside the deviceready handler, as in the code below. 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 with callbacks 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 Cordova plugin and configure it with your key

The RevenueDot plugin is built from RevenueCat's open-source plugin (MIT license), so your code calls the global Purchases. It sends every request to RevenueDot and needs no RevenueCat account.

device.platform comes from cordova-plugin-device.

Self-hosting? Call Purchases.setProxyURL(...) with your server's URL before configureWith. The plugin has no verification option, and your server signs with its own key, so the native SDKs log a failed check for every response unless you build the plugin with your own public key. Access is still granted. See Trusted Entitlements.

Install, then configure on devicereadyTerminal and JavaScript
cordova plugin add @revenuedot/cordova-plugin-purchases

// www/js/index.js
document.addEventListener("deviceready", () => {
  Purchases.configureWith({ apiKey: device.platform === "iOS" ? "appl_..." : "goog_..." });
});

JavaScript

Check the entitlement, then buy a package

Check access and buy with callbacksJavaScript
Purchases.getOfferings(
  (offerings) => {
    const aPackage = offerings.current && offerings.current.availablePackages[0];
    if (!aPackage) return;
    Purchases.purchasePackage(
      aPackage,
      ({ customerInfo }) => {
        const nowPro = customerInfo.entitlements.active["pro"] !== undefined;
      },
      ({ error, userCancelled }) => { if (!userCancelled) console.error(error); }
    );
  },
  (error) => console.error(error)
);

Notes

Check these Cordova details before you ship

  • Test Store keys work in debug builds only. Ship with appl_ and goog_ keys.
  • Xcode 27 rejects pods that target iOS 13. Set <preference name="deployment-target" value="15.0" /> in config.xml and raise the pod targets in a post_install block. See the Cordova guide.
  • Status: there is no Cordova example app yet.

Switch

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

If your app already ships RevenueCat's cordova-plugin-purchases, you can keep it. Call Purchases.setProxyURL before configureWith. 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.

  • Signature log: the stock plugin has no option to turn off signature checks, so the native SDKs log a failed check for every RevenueDot response. Access is still granted, because the native default mode is informational. The RevenueDot plugin removes the noise against RevenueDot Cloud.
  • Keys: the importer keeps your RevenueCat appl_ and goog_ keys working, so builds you already shipped keep their keys.
Point the RevenueCat plugin at RevenueDotJavaScript
document.addEventListener("deviceready", () => {
  Purchases.setProxyURL("https://api.revenuedot.app");   // returns nothing
  Purchases.configureWith({
    apiKey: device.platform === "iOS" ? "appl_..." : "goog_...",
  });
  // Once, on the first launch of this update
  Purchases.syncPurchases();
});

FAQ

Cordova: questions people ask

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

No. The RevenueDot plugin is built from RevenueCat's open-source Cordova 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.configureWith.

How do I add in-app purchases to a Cordova app?

Run cordova plugin add @revenuedot/cordova-plugin-purchases, configure it on deviceready 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.

Does RevenueDot work with Cordova on iOS and Android?

Yes. The RevenueDot plugin uses RevenueDot's native iOS and Android SDKs underneath, so App Store and Google Play purchases are handled the same way as in native apps.

Why does Xcode reject the plugin's pods?

Xcode 27 rejects pods that target iOS 13, and the stock plugin's pods do too. Set the deployment-target preference to 15.0 in config.xml and raise the pod targets with a post_install block or an after_prepare hook.

Can I turn off signature verification in RevenueCat's Cordova plugin?

No. configureWith has no verification option, so the native default, informational, applies. Every RevenueDot response is logged as a failed check and access is still granted. The RevenueDot plugin trusts RevenueDot's key, so the noise goes away on Cloud.

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