Claude Code · StoreKit 2 · Google Play Billing
In-app purchases for web apps built with Claude Code
Claude Code can write your whole product: React or Next.js frontend, API, database, Stripe. Selling it on the App Store adds native billing, App Store Connect setup, receipt verification and server notifications. AppNative handles the native half so Claude Code only has to add a few lines to your web app.
How do I add App Store in-app purchases to an app I built with Claude Code?
Keep the app as a web app and wrap it with AppNative. AppNative builds the native iOS and Android apps with StoreKit 2 and Google Play Billing, creates your products in App Store Connect and Google Play, and exposes window.AppNative.iap to your code. Then ask Claude Code to call showPaywall() from the upgrade button inside the app, register onEntitlementsChanged at startup, and add a backend route that verifies signed transactions and Apple and Google server notifications. No Swift, Kotlin or Xcode project to maintain.
- Stack
- React, Next.js, Vite, Remix, SvelteKit or any web framework
- iOS billing
- StoreKit 2
- Android billing
- Google Play Billing
- Your code
- A showPaywall() call, an entitlement listener and one sync route
- Server events
- App Store Server Notifications V2 and Google RTDN to your API
- Docs for the agent
- appnative.io/api-docs has copy-paste prompts for Claude Code
How to turn a Claude Code app into a native mobile app, step by step
Six steps, one codebase, no native development. Each step happens inside AppNative except the first.
- 1
Deploy the web app
Ship it wherever you host today: Vercel, Netlify, Fly, Railway, Render or your own server.
- 2
Wrap it with AppNative
Connect the URL or repo. AppNative builds and signs the iOS and Android apps in the cloud.
- 3
Create products in AppNative
Add your plans once. AppNative creates them in App Store Connect and Google Play.
- 4
Hand Claude Code the IAP prompt
Paste the in-app purchase prompt from AppNative's API docs into Claude Code. It adds setUser() after login, onEntitlementsChanged at startup, showPaywall() on the upgrade button and a verified sync route.
- 5
Test in TestFlight
Install the TestFlight build, buy with a sandbox account, and confirm your database flips the user to paid.
The code your Claude Code 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
}Full reference and copy-paste prompts for AI builders are in the AppNative API docs.
What your Claude Code app gets for in-app purchases
These are real native implementations compiled into the binary — not browser fallbacks — and they're what moves an app past Apple's "minimum functionality" bar.
- Real StoreKit 2 purchase sheet on iOS and Google Play Billing on Android, inside your existing web app
- Auto-renewable subscriptions, consumables, non-consumables, lifetime unlocks and free trials
- Products created for you in App Store Connect and Google Play, including prices, trials and localizations
- Native paywalls in several layouts, with copy and design generated by AI from your brand colors
- window.AppNative.iap bridge: showPaywall, setUser, onPurchase, onEntitlementsChanged, getEntitlements, hasFeature, manageSubscriptions
- Restore Purchases, upgrades, downgrades, grace periods and billing retry handled natively
- Apple App Store Server Notifications V2 and Google Play Real-time Developer Notifications wired to your backend
- Entitlements synced to your own database (Base44 entities, Supabase, Firebase or any API) so web and mobile agree
- Keep Stripe for web and desktop customers while the native app uses Apple and Google billing
- RevenueCat mode if you already run RevenueCat, native StoreKit mode if you'd rather skip the extra fee
Claude Code in-app purchases: the options, compared
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.
Wrap the web app or ask Claude Code for a native rewrite?
Claude Code can scaffold a React Native or Swift app, but then you own two codebases, native build tooling and StoreKit edge cases like grace periods and refunds. Wrapping keeps one web codebase and moves the native billing work to AppNative.
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.
Claude Code in-app purchases: every question, answered
The exact questions people ask before shipping a Claude Code project to the App Store and Google Play.
Can Claude Code write StoreKit code?
It can, but a web app can't run it. StoreKit needs a native target, signing and App Store Connect products. AppNative provides those, and Claude Code only edits your web code.
What do I tell Claude Code exactly?
AppNative's API docs include ready-made prompts for unlocking pro features, renewals, account matching and server notifications. Paste the one you need into Claude Code.
How do I verify purchases on my server?
Each entitlement includes signedTransactionInfo. Your route verifies it with Apple's public keys, matches appAccountToken to the user, and saves the result.
Can I keep my Stripe billing?
Yes. Browser users keep paying through Stripe; app users pay through Apple or Google. Both update the same record.
Web app to mobile app: key terms defined
- Native app wrapper
- A native app wrapper is a compiled iOS or Android application that renders your existing web app inside a native web view (WKWebView on iOS, WebView on Android) while exposing real device capabilities — push notifications, biometrics, camera, in-app purchases — to that web code through a JavaScript bridge.
- Hybrid app
- A hybrid app ships web technologies (HTML, CSS, JavaScript) inside a native binary that can be distributed through the App Store and Google Play. It differs from a progressive web app, which is installed from the browser and cannot be listed in either store.
- App Store guideline 4.2 (minimum functionality)
- Apple's rule that an app must do more than repackage a website. Apps that add native capability — push notifications, biometric login, camera use, offline support, widgets, in-app purchases — satisfy it; a bare website in a shell does not.
- Bundle ID / package name
- The permanent reverse-domain identifier for your app (for example com.yourcompany.yourapp). It's registered once with Apple and Google and can never be changed for a published app, so it must be decided before your first submission.
- Code signing and provisioning profile
- Apple requires every binary to be signed with a distribution certificate and matched to a provisioning profile tied to your bundle ID and team. Android requires an upload keystore. Without them a build cannot be installed or submitted.
- TestFlight
- Apple's beta distribution service. Uploading a signed build to TestFlight lets up to 100 internal testers install the app immediately, before public App Store review — the fastest way to see your wrapped app on a real device.
- Over-the-air update
- Because a wrapper renders your live web app, deploying your web app updates the mobile experience instantly with no store review. A new native build is only required when something inside the binary changes: icon, splash screen, bundle ID or a native capability.
- StoreKit and Google Play Billing
- The in-app purchase systems Apple and Google require for selling digital goods inside an app. Stripe stays valid on the web, so most apps run both and grant the same entitlement from either payment source.
Claude Code in-app purchases: frequently asked questions
Can I publish a Claude Code web app to the App Store with subscriptions?
Yes. AppNative wraps it as a native iOS and Android app with StoreKit 2 and Google Play Billing and handles product creation and submission.
Do I need Xcode?
No. AppNative builds, signs and uploads in the cloud.
Does this work with Cursor, Windsurf or Codex apps too?
Yes. Any web app works, whichever coding tool wrote it.
Is RevenueCat required?
No. Native StoreKit mode works on its own. RevenueCat mode is there if you want it.
Native features only AppNative adds to a wrapped web app
In-app purchases, Live Activities, WidgetKit widgets and rich push are compiled into your binary as real native extensions — designed through AI chat, driven by your data.
Sell subscriptions with Apple and Google in-app purchases
StoreKit 2 and Google Play Billing for apps built with any AI builder or coding agent. Products created for you, native paywall, entitlements synced to your database, Stripe kept for web.
Ship from your AI app builder
Writing your app with an AI coding tool? These guides cover the same setup for other builders and stacks.
Deep dives by builder and feature
Step-by-step guides for the specific thing you're trying to ship — push, in-app purchases, widgets, store submission — for Lovable and Base44 apps, plus how AppNative compares to Median.co and Despia.
Lovable mobile app guides
In-app purchases, RevenueCat, Capacitor, Stripe rules and Google Play for Lovable apps, with prices checked on each vendor's site.
Publishing guides
Apple and Google rules, costs, review times and rejections, checked against the official pages.
Start selling subscriptions in your Claude Code app
Connect your repo, toggle the native features you need, press Build. Your first TestFlight build can be in testers' hands today — and your Claude Code workflow doesn't change at all.