Failing to get InAppPurchase2 to work to do IAP in-app purchase with Ionic Vue

Lost in the wilderness if anyone can help me, much appreciated. I tried to integrate import { InAppPurchase2, IAPProduct } from '@awesome-cordova-plugins/in-app-purchase-2'; based on In App Purchase 2 - Awesome Cordova Plugins

and this tutorial for Angular: How to use Ionic In App Purchase with Capacitor | Devdactic

npm install @awesome-cordova-plugins/in-app-purchase-2
npm i cordova-plugin-purchase
(I did not know which to use)
npm i cc.fovea.cordova.purchase

I get these errors–the plugins are not initializing?

[Warning] Native: tried calling InAppPurchase2.when, but the InAppPurchase2 plugin is not installed. (chunk-vendors.0a794c7c.js, line 16)
[Warning] Install the InAppPurchase2 plugin: 'ionic cordova plugin add cordova-plugin-purchase' (chunk-vendors.0a794c7c.js, line 16)
TypeError: Cs.g.when("product").approved is not a function. (In 'Cs.g.when("product").approved((e=>(,e.verify())))', 'Cs.g.when("product").approved' is undefined)

The execution path is:

import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2';

// Register products
  id: 'product_id',
  type: InAppPurchase2.CONSUMABLE

// Handle the product deliverable after purchase
InAppPurchase2.when('your_product_id').approved(product => {
  // Handle successful purchase here

Any help with what to do would be much appreciated. Should I be using GitHub - RevenueCat/purchases-capacitor: Capacitor in-app purchases and subscriptions made easy. instead?

The answer is yes, RevenueCat purchases-capacitor is the answer; works perfectly with a great SaaS backend. The state of everything else is not viable imho.

Just to be clear, you are talking about two completely different plugins. cordova-plugin-purchase (with a Capacitor wrapper of @awesome-cordova-plugins/in-app-purchase-2 is a product of Fovea. The developer now recommends using the Cordova plugin directly without the Capacitor wrapper.

Then there is RevenueCat which now has a first party Capacitor plugin that you mentioned.

I am also a happy RevenueCat user in my Vue & Capacitor app :star_struck: I found RevenueCat pretty easy to implement and the support has been great so far.

Thanks for that clarification. I was confused by all the wrapping and developer migrations. Great to hear of your good experience with RevenueCat.