AppNative › Blog › In-app purchases

How to add in-app purchases to a web app built with Cursor or Windsurf

Updated November 2026 · By the AppNative team

Short answer: Wrap the deployed app with AppNative, create your products in AppNative, and ask Cursor's agent to call window.AppNative.iap.showPaywall() from the upgrade button when running inside the app. Register onEntitlementsChanged once at startup and add a backend route that verifies transactions. AppNative handles StoreKit 2, Google Play Billing, App Store Connect products and Apple and Google server notifications.

You built a real web app in Cursor or Windsurf. To sell it in the App Store you need Apple billing, which means native code you'd rather not maintain. AppNative wraps the app for iOS and Android with StoreKit 2 and Google Play Billing so your agent only touches the web code.

Cursor in-app purchases at a glance

EditorsCursor, Windsurf, Codex, Copilot or any IDE
iOS billingStoreKit 2
Android billingGoogle Play Billing
Native code you writeNone
Rules fileAdd AppNative's bridge docs to .cursor/rules so the agent uses the right API
Web paymentsStripe unchanged

How to add in-app purchases to a web app built with Cursor or Windsurf

  1. Deploy your app. Any host works. AppNative only needs a live URL or the repo.
  2. Wrap it with AppNative. Signed iOS and Android builds are produced in the cloud.
  3. Create your products. AppNative creates them in App Store Connect and Google Play.
  4. Give the agent the bridge docs. Paste AppNative's in-app purchase prompt into Cursor or Windsurf, or save it as a rules file so every future change uses the same API.
  5. Verify on your server. Add the sync route and point Apple and Google server notifications at it.

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.

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.

Native StoreKit vs RevenueCat

Native StoreKit mode keeps everything inside your own Apple and Google accounts with no third-party revenue share. RevenueCat adds its own dashboard and analytics on top. AppNative supports both, so you can pick per app and switch later.

Common questions

Do I need a separate React Native app?

No. Your web app is the app. AppNative wraps it and adds native billing, push, widgets and more.

How does the app know it's running natively?

Check for window.AppNative. Inside the iOS and Android apps it exists; in a browser it doesn't, so your Stripe flow runs instead.

Can my agent test purchases?

You test them on a device with TestFlight and an Apple sandbox account. Your agent can read the server logs to confirm the sync worked.

Can I sell a Cursor-built web app on the App Store?

Yes. AppNative turns it into a native app with Apple in-app purchases and handles submission.

Is this different from Capacitor?

Capacitor gives you a native project to maintain and you still integrate StoreKit yourself. AppNative builds in the cloud and includes billing, product setup and server notifications.

Does it work for Next.js apps?

Yes, including server-rendered Next.js on Vercel.

Add in-app purchases with AppNative

In-app purchase guides for other builders

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