Add in-app purchases and paywalls to your Apache Cordova app with one JavaScript API for iOS and Android.
The Cordova plugin is on the roadmap and is not published yet.cashsdk-cordova does not
resolve from any registry today, so the code on this page describes the
intended API rather than a package you can install.
Shipping now? Use the iOS or Android SDK, which are
available today. To be notified when this one lands, contact
support@cashsdk.com.
The CashSDK Cordova plugin brings the same offerings-and-entitlements API to
Apache Cordova apps. It wraps StoreKit 2 on iOS and Play Billing on Android and
exposes a single, promise-based JavaScript API that runs unchanged on both
platforms.
In-app purchases require native code, so the plugin runs on a device or
simulator/emulator, not in a browser preview. Purchases are validated
server-side, so entitlements stay trustworthy regardless of the client.
The plugin is available once Cordova fires deviceready. Configure CashSDK there,
before any screen that reads entitlements, using your publishable key.
Pass a package to purchase. CashSDK drives the native store flow, validates the
receipt server-side, and resolves with the customer's updated entitlements.
js
const result = await CashSDK.purchase(offering.monthly);
if (result.entitlements.pro?.isActive) {
unlockPro();
}