◉RORK LABJP
●SUBDOMAIN — Rork can now connect your web app to a subdomain only, leaving your root domain and www untouched (12/1)●UPDATES — expo-updates 58.0.23 fixes Android release builds embedding a stale runtime version●FLASH END — Intro pricing for Gemini Flash models ends 12/31, 29 days from now. Time to recheck AI feature costs●HMR — Some report the dev server picking up another server's bundle and then exiting●FIRST VIEW — Map the first screen for a normal launch, a notification, and a link, and back navigation stops surprising you●CARBON — Gemini 4 Carbon and Argon are now at standard rates: $4.00 input, $20.00 output per 1M tokens●SUBDOMAIN — Rork can now connect your web app to a subdomain only, leaving your root domain and www untouched (12/1)●UPDATES — expo-updates 58.0.23 fixes Android release builds embedding a stale runtime version●FLASH END — Intro pricing for Gemini Flash models ends 12/31, 29 days from now. Time to recheck AI feature costs●HMR — Some report the dev server picking up another server's bundle and then exiting●FIRST VIEW — Map the first screen for a normal launch, a notification, and a link, and back navigation stops surprising you●CARBON — Gemini 4 Carbon and Argon are now at standard rates: $4.00 input, $20.00 output per 1M tokens
Articles/Dev Tools
⬡ Dev Tools/2026-04-25Advanced

Outgrowing RevenueCat: A Self-Hosted Guide to App Store Server Notifications V2 for Rork Apps

A complete implementation guide for receiving App Store Server Notifications V2 in Cloudflare Workers without RevenueCat — covering JWS verification, idempotent state updates, user binding, and production testing for Rork apps.

StoreKit 217App Store Server API4Cloudflare Workers26Subscriptions17JWS3

✦ Premium Article

If you've been running RevenueCat for a year or so, there's a good chance you've quietly started wondering whether the monthly fee will become a problem as MRR keeps climbing. I had the exact same feeling once revenue from three Rork-built apps started to compound. RevenueCat is genuinely a great service and I'd recommend it for the first subscription app you ship. But once the business has matured, it's also natural — perhaps inevitable — to want the verification logic living inside your own codebase.

This guide walks you through that "graduation" at the implementation level. Specifically, we'll build a minimal but production-ready setup: a Rork iOS app that completes purchases through StoreKit 2, a Cloudflare Workers endpoint that receives App Store Server Notifications V2 (ASSN V2 from here on), JWS verification of those payloads, and idempotent state writes to Cloudflare KV. Everything below is based on the setup I run myself, including the missteps I made along the way.

Why Go Self-Hosted — This Isn't an Anti-RevenueCat Pitch

Before we dive in, let me say this clearly: I'm not trying to talk anyone off RevenueCat. For your very first subscription app, I'd actively recommend it. Building an in-house verification flow takes one or two weeks at minimum, and testing server-to-server notifications is much messier than it looks on paper. Burning that time before you've validated the product is almost always the wrong trade.

That said, the moment a few of these conditions hold, self-hosting starts being worth a serious look:

  • Monthly Tracked Revenue has crossed a threshold where RevenueCat's pricing tier visibly affects your margins
  • You want fine-grained billing logic per user — region-specific pricing, internal coupons, one-off offers — that doesn't quite map to what RevenueCat exposes through its dashboard
  • Audit or privacy requirements have started limiting where payment-related state can live, and "anywhere outside your servers" is no longer comfortable
  • You've started writing custom analytics on top of RevenueCat's webhooks and find yourself fighting their data model more than using it

If any of those resonate, self-hosting is genuinely worth the engineering investment. On the other hand, if MRR hasn't really lifted off yet and the only motivator is "the cost feels uncomfortable," I'd hold off. A single verification bug can stop a day of revenue, and that lost day will almost always cost more than a year of RevenueCat fees. The way I've come to think about it: leave RevenueCat the moment its abstraction stops compressing your work, and not a moment earlier.

The Big Picture: StoreKit 2 → ASSN V2 → Cloudflare Workers → KV

Before any code, let's pin down the data flow:

  1. The user purchases a subscription inside the Rork app — StoreKit 2 handles the transaction
  2. After completion, Apple's servers send a JWS-signed notification (ASSN V2) to a URL you've registered
  3. Cloudflare Workers receives the notification and verifies the JWS against Apple's root certificate chain
  4. From the verified payload we extract originalTransactionId and notificationType, then write idempotently to Cloudflare KV
  5. On app launch, the client asks the server for its current entitlement instead of relying purely on local state

The key idea is that the source of truth lives along the Apple → Workers → KV path. Trusting Transaction.currentEntitlements on the client alone means your server has no idea who currently has an active subscription, which kills any downstream operation like targeted email, web-side membership, or churn-prediction work. On-device checks are convenient; they just make a poor source of truth across devices and the web.

There's also a more subtle benefit to this layout. Because the client's role shrinks to "trigger the purchase, then ask the server what's true," you stop accumulating fragile state on devices. Lost devices, restored backups, switched Apple IDs — all of these become server-side reconciliation problems instead of client-side bugs. That alignment with the server is, to me, the single biggest reason this architecture pays off in the long run. It also turns out to be how you sleep well at night: when something does go wrong, you can answer it from inside your own code, with logs you wrote and data you control, instead of refreshing someone else's status page and hoping their team is awake.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Indie developers who feel RevenueCat's monthly fee is starting to weigh on their margins can now move to a self-hosted Cloudflare Workers receiver for App Store Server Notifications V2
✦You'll learn how to verify JWS signatures, handle replay-safe status transitions, and update subscription state idempotently — with working code that runs in a Rork project
✦By switching to a self-hosted setup you can drive fixed costs close to zero and keep full control over the verification logic that powers your subscription business
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Dev Tools2026-04-28
Why In-App Purchases Disappear with Family Sharing — Building Bulletproof IAP for Family Apps with Rork
Subscription revenue from Family Sharing purchases can vanish days after the sale settles. This guide covers the four refund triggers, a StoreKit 2 + Server Notifications V2 implementation for Rork apps, and a StoreKit Testing matrix that catches family edge cases before launch.
⬡ Dev Tools2026-10-20
Why Redeploying Doesn't Fix the Application Error You See Right After a Deploy
Right after I swapped a secret, every page showed Application error. Stale HTML was calling a JS file that no longer existed. Here are a detection script, a build-version check for the edge cache, and a once-only auto-reload, all run and verified.
⬡ Dev Tools2026-05-09
Building a Rork A/B Testing Platform with GrowthBook and PostHog from Scratch
Drop Firebase and pair GrowthBook with PostHog to ship an A/B testing stack for your Rork apps: SDK wiring, a KV-cached feature endpoint on Cloudflare Workers, sample-size math, SRM checks, and the operational pitfalls.