Simpler setup, proper ES module imports, future-proof
The cordova-plugin-purchase plugin now ships with a native Capacitor edition. If you're using the Cordova plugin inside a Capacitor app, you can switch to the dedicated Capacitor package for a cleaner integration.
What Changed
The plugin now provides a native Capacitor bridge alongside the existing Cordova bridge:
- iOS: Native StoreKit 2 integration
- Android: Native Google Play Billing 8.3 integration
- Same API: The
CdvPurchase.StoreAPI is identical -- your purchase logic stays the same
The key difference is how you install and import the plugin.
Why Switch
Simpler setup -- Install with npm and sync, no Cordova compatibility layer needed:
npm install capacitor-plugin-cdv-purchase
npx cap sync
Clean ES module imports -- No more globals. Import what you need directly:
import { store, ProductType, Platform } from 'capacitor-plugin-cdv-purchase';
Future-proof -- The Capacitor package follows modern JavaScript module conventions and integrates natively with the Capacitor build pipeline.
How to Migrate
-
Uninstall the old plugin (and
cordova-plugin-purchase-storekit2if installed):npm uninstall cordova-plugin-purchase cordova-plugin-purchase-storekit2 -
Install the Capacitor plugin:
npm install capacitor-plugin-cdv-purchase npx cap sync -
Update your imports:
// Before (Cordova global): const store = CdvPurchase.store; // After (ES module): import { store } from 'capacitor-plugin-cdv-purchase'; -
The rest of your code stays the same.
Get Started
- Setup guide -- Full integration guide with Iaptic
- Plugin documentation -- Features and API overview
- GitHub Repository -- Source code
- Example projects -- Working Capacitor examples
