AppNative › Blog › In-app purchases

How to add in-app purchases and subscriptions to a Replit app

Updated November 2026 · By the AppNative team

Short answer: Deploy your Replit app, then wrap it with AppNative. AppNative builds a native iOS and Android app around your Replit deployment URL with StoreKit 2 and Google Play Billing compiled in, creates your products in App Store Connect and Google Play, and opens a native paywall when your upgrade button calls window.AppNative.iap.showPaywall(). Your Replit backend receives verified purchases and Apple and Google server notifications, so it stays the single source of truth for who is subscribed.

Replit Agent can build and deploy a full-stack web app in an afternoon, and it can wire up Stripe. What it can't do is ship StoreKit, because StoreKit only exists in a native iOS binary. AppNative wraps your deployed Replit app as a native iOS and Android app with Apple and Google billing built in, so you can sell subscriptions on the App Store without touching Swift.

Replit in-app purchases at a glance

SourceYour Replit deployment URL (Autoscale, Reserved VM or Static)
iOS billingStoreKit 2
Android billingGoogle Play Billing
BackendYour Replit Express, Flask or Next.js server verifies and stores entitlements
DatabaseReplit PostgreSQL or any database you already use
Web paymentsKeep the Stripe checkout Replit Agent built for you

How to add in-app purchases and subscriptions to a Replit app

  1. Deploy your Replit app. Publish it with Replit Deployments so it has a stable URL. A custom domain is ideal but not required.
  2. Wrap it with AppNative. Paste the deployment URL. AppNative builds signed iOS and Android apps around it in the cloud, no Mac or Xcode needed.
  3. Create your products. Add your plans once in AppNative. They are created in App Store Connect and Google Play with the prices and trials you choose.
  4. Ask Replit Agent to add the bridge. Tell Agent: when window.AppNative.iap exists, the upgrade button should call window.AppNative.iap.showPaywall() instead of opening Stripe. Add an /api/iap/sync route that verifies transactions and saves the entitlement.
  5. Point server notifications at Replit. Paste your Replit endpoint into AppNative for Apple and Google server notifications so renewals, refunds and cancellations update your database automatically.

The code your web app needs

Everything native is handled by AppNative. Your web code identifies the user, listens for entitlement changes and opens the paywall. In a normal browser the same button keeps using Stripe.

// 1. Right after sign-in (not inside the buy button)
const token = await window.AppNative?.iap?.setUser(user.iapUuid);

// 2. Once at app start: renewals, expiries, refunds and upgrades land here
window.AppNative?.iap?.onEntitlementsChanged((list) => {
  const active = list.filter((e) => e.isActive && !e.revocationDate && !e.isUpgraded);
  syncEntitlements(active); // your backend verifies and saves them
});

// 3. Your existing upgrade button
function upgrade() {
  if (window.AppNative?.iap) return window.AppNative.iap.showPaywall(); // Apple / Google
  window.location.href = "/checkout"; // Stripe, unchanged, on the web
}

Your backend should verify each entitlement's signedTransactionInfo before granting access, and match appAccountToken to the signed-in user. See the AppNative API docs for copy-paste prompts you can give your AI builder.

What AppNative's in-app purchase layer includes

Why Stripe inside the app gets rejected

App Store Review Guideline 3.1.1 says digital content, subscriptions, credits and premium features bought inside an iOS app have to go through Apple's in-app purchase. A Stripe checkout page loaded inside a wrapped web app is one of the most common rejections for AI-built apps. The fix that keeps your revenue intact: Stripe stays on the web, StoreKit runs in the native app, and both write to the same subscription record.

Why not just use Replit's mobile tooling?

If your app is already a web app on Replit, rebuilding it as a separate Expo or React Native project means two codebases and a StoreKit integration you write yourself. Wrapping the web app keeps one codebase, and AppNative supplies the native billing.

AppNative vs Median.co, Despia and other wrappers

Most webview wrappers expose a purchase bridge and leave the rest to you: creating products in App Store Connect, building a paywall, verifying transactions, handling renewals and refunds. AppNative does all of that. It creates the products, generates the native paywall, verifies every transaction, and wires Apple and Google server notifications into your own database.

Common questions

Can Replit Agent add Apple in-app purchases by itself?

Not to a web app. Agent can write the JavaScript side, but the purchase sheet has to come from a native binary. AppNative provides that binary and the bridge Agent's code calls.

Where do I verify purchases?

In your Replit server. AppNative passes signed transaction data to your code, and your sync route verifies it before granting access.

Do I keep my Replit Stripe integration?

Yes. Stripe keeps working in the browser. Only the native apps use Apple and Google billing.

Will my Replit app update without resubmitting?

Yes. Web deploys show up in the app right away. You only resubmit for native changes like new products or capabilities.

Can I sell subscriptions in a Replit app on the App Store?

Yes, through Apple in-app purchase. AppNative wraps the Replit app as a native iOS app with StoreKit 2 and handles product creation, the paywall and verification.

Why did Apple reject my Replit app with Stripe?

Guideline 3.1.1 requires digital goods sold inside iOS apps to use Apple's in-app purchase. Show the native paywall in the app and keep Stripe for the web.

Does it work for Replit apps using Supabase or Firebase?

Yes. Your sync route can write the entitlement wherever your user data lives.

Do I need a Mac?

No. AppNative builds, signs and uploads in the cloud.

Add in-app purchases with AppNative

In-app purchase guides for other builders

More: In-app purchases for Replit apps · Live Activities for web apps · Widgets for web apps · Rich push notifications