Skip to content

feat: add RevenueCat integration templates and modular scaffolding support for native apps#229

Open
Alisha-21-cloud wants to merge 7 commits into
Marve10s:mainfrom
Alisha-21-cloud:feat/add-revenuecat-payments
Open

feat: add RevenueCat integration templates and modular scaffolding support for native apps#229
Alisha-21-cloud wants to merge 7 commits into
Marve10s:mainfrom
Alisha-21-cloud:feat/add-revenuecat-payments

Conversation

@Alisha-21-cloud

@Alisha-21-cloud Alisha-21-cloud commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Add RevenueCat Payments Integration for Native Apps

Description

This PR introduces RevenueCat as a new payments provider for in-app purchases on native (Expo / React Native) applications.

Unlike the existing Polar integration (which is web-focused and Better-Auth dependent), RevenueCat is native-gated and auth-agnostic. It is exclusively offered when a native frontend is selected (native-bare, native-uniwind, or native-unistyles) and when a backend is present.

Key Features & Implementation Details

1. Core Integration & Configuration

  • Schema & Validation: Added revenuecat to PaymentsSchema.
    • Prompts conditionally offer RevenueCat only when a native frontend is present.
    • validatePaymentsCompatibility now correctly errors if RevenueCat is selected without a native frontend.
    • Added new Matrix oracle cases (e.g., payments-revenuecat-requires-native-frontend).
  • Web Stack-Builder: Added RevenueCat to apps/web with a native-frontend requirement constraint, mirroring how Polar gates on Better-Auth.

2. Convex Backend Support

  • Component Wiring: Integrates the convex-revenuecat component via app.use(revenuecat) in convex.config.ts.
  • Webhook Routing: Registers a RevenueCat webhook route (POST /webhooks/revenuecat).
    • Template Handler Logic: If Better-Auth is present, the webhook is appended to the existing Better-Auth http.ts. If no Better-Auth is used (e.g., Clerk or none), a standalone http.ts is generated to avoid clobbering routes.
  • Client API: Exposes a revenuecat.ts client with utilities like hasEntitlement, isSubscriber, and getActiveSubscriptions.
  • Other Backends: For backends other than Convex, the implementation gracefully falls back to a pure frontend React Native SDK integration (react-native-purchases), as RevenueCat handles subscription state independently.

3. Native Scaffolding & Components

  • Provider & SDK: Scaffolded a shared, auth-agnostic RevenueCatProvider and a lib/revenue-cat SDK layer.
  • UI Components: Added subscription-status-card and paywall-example components.
    • Fully styled across all three variants: standard StyleSheet (native-bare), NativeWind (native-uniwind), and unistyles (native-unistyles).
  • Layout Integration: The RevenueCatProvider is conditionally wrapped and mounted within each variant's app/_layout.tsx.

4. Environment Variables

  • Native (.env): Scaffolds EXPO_PUBLIC_REVENUECAT_IOS_KEY, EXPO_PUBLIC_REVENUECAT_ANDROID_KEY, and EXPO_PUBLIC_REVENUECAT_ENTITLEMENT_ID.
  • Convex (.env.local): Adds REVENUECAT_WEBHOOK_AUTH along with helpful setup comments for local development.

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

@Alisha-21-cloud is attempting to deploy a commit to the Ibrahim's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). labels Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants