Browse the documentation

In-app subscriptions plugin (RevenueCat)

2026-11-01· 3 min read· View as Markdown

This plugin sells Google Play subscriptions from your website code, through RevenueCat. Your site opens the purchase sheet and receives the result. There's no native code to write and no commission from SaasToStore. It works on Android today; iOS is coming later.

Platforms

Included
  • Android
  • iOS — coming later

Used by the native builds: Android Build (Native), Android TV and iOS. The Android Build (Web) does not read these settings.

Fields to fill in

FieldWhere to find itExample
Android API keyRevenueCat, public key of your Android appgoog_xxxxxxxx
Entitlement IDRevenueCat, the access your subscription givespremium

The API key is public by design and ends up inside the app. Never paste a secret key here.

Set it up

  1. Add the plugin

    In your project's plugin library, add In-App Subscriptions, then fill in the two fields.

  2. Launch a new build

    It needs an Android Build (Native) with native navigation.

  3. Add the calls to your site

    Identify the signed-in person, read their status, then start a purchase from your button.

JavaScript API

const billing = await whenSaasToStore("billing");

window.addEventListener("s2s:billing", (e) => {
  const d = e.detail;
  if (d.type === "identify_result" && d.success) billing.getStatus();
  if (d.type === "status") setPremium(d.isEntitled);
  if (d.type === "purchase_result" && d.success) setPremium(d.isEntitled);
});

if (billing?.isAvailable) billing.identify(currentUser.id);
billing.purchase("premium_monthly"); // from your button

Read In-app purchases for the full guide: events, tests, and what to do on iOS.

Prompt for AI builders

Prompt for Lovable, Bolt or Base44

My website also runs inside an Android app. Inside the app, window.saastostore?.billing sells Google Play subscriptions. In a normal browser it doesn't exist, and nothing must change.

When navigator.userAgent includes "SaasToStoreApp" and billing.isAvailable is true:
- call billing.identify(user.id) after sign-in, then billing.getStatus() after the identify_result event;
- make my upgrade button call billing.purchase("[PRODUCT ID]") instead of my web checkout;
- add a "Restore purchases" button that calls billing.restore().

Results arrive as a window event named "s2s:billing". event.detail.type is identify_result, purchase_result, restore_result or status. Unlock premium when status or purchase_result gives isEntitled: true.

On iPhone inside the app, hide the upgrade button.

Replace the values in [BRACKETS].

Frequently asked questions

Is it available on iOS?+

Not yet. Hide your purchase button in the iOS app until it is.

Does SaasToStore take a commission?+

No. You pay Google's fees and, above its free tier, RevenueCat's.

Can I sell one-time purchases?+

The plugin checks an entitlement, so it's built for subscriptions. Non-subscription products configured in RevenueCat haven't been tested with it.

Why doesn't the purchase sheet open?+

Purchases only work in an app installed from a Google Play test track or from the store, with a product that's active in the Play Console.

See it with your own site

Paste your URL and get a free Android test build on your phone in about 3 minutes.

Publish now

Keep reading