Revenue Cat

RevenueCat functions exposed through the WebToNative for your seamless in-app purchases and subscription management across iOS and Android.

You'll need to import the javascript file in your website before starting from this link.

const { configure, isInitialized, setUserId, getCustomerInfo, showPaywall, makePurchase, restorePurchase } = window.WTN.RevenueCat;

//Initialises the RevenueCat SDK on iOS/Android.
configure({
    apiKey: "YOUR_REVENUECAT_API_KEY",
    userId: "optional_user_id", // optional
    callback: (response) => {
        console.log(response);
    }
});

//Check If SDK Is Initialised
isInitialised({
    callback: (response) => {
        console.log(response);
    }
})


//Setting User Id
setUserId({
    userId: "user_id",
    callback: (response) => {
        console.log(response);
    }
})

//Getting customer info
getCustomerInfo({
    callback: (response) => {
        console.log(response);
    }
})

//Showing th paywall
showPaywall({
    offeringId:"revenue_cat_offering_id",
    callback: (response) => {
        console.log(response);
    }
})

//Invoke default In App Purchase
makePurchase({
    productId:"store_product_id",
    callback: (response) => {
        console.log(response);
    }
})

//Restoring a purchase
restorePurchase({
    callback: (response) => {
        console.log(response);
    }
})

Responses for the above fuctions

Last updated

Was this helpful?