--- name: revenuecat description: Guidelines for using RevenueCat to integrate payments in mobile apps and any subsequent CRUD operations related to any RevenueCat entities # Note: ./references/replit-revenuecat-sdk-docs.md is copy-pasted manually from https://github.com/replit/revenuecat-sdk/blob/main/docs/SDK.md and was last updated: 2026-03-19 for version 4.0.0 --- ## Introduction - RevenueCat lets users monetize their native mobile apps on Replit. - The RevenueCat integration is only intended to be used for the Expo/mobile stack on Replit. - If the stack used is *not* Expo/mobile, do not use RevenueCat, and instead suggest the Stripe integration. - The package used in the React Native client code is `react-native-purchases`. Always download the version that is compatible with the version of React Native/Expo used in the app. ## Prerequisites 1. These packages must be installed: - `react-native-purchases` - Official client-side SDK for React Native. This should be used on the client. This MUST be installed inside the target mobile workspace package, not in the root of the monorepo - `@replit/revenuecat-sdk` - SDK for RevenueCat's REST API. This should NEVER be used on the client, only for server-side scripts. This MUST be installed in the root of the workspace If they are not installed, use pnpm to install them. Installing to monorepo root: `$ cd /home/runner/workspace && pnpm add -w ` Installing to workspace package: `$ cd /home/runner/workspace/:package_path && pnpm add ` 2. The RevenueCat integration must be connected to the repl. This is necessary as the integration creates an authenticated client for RevenueCat accessible via a function `getUncachableRevenueCatClient`. You can do this by proposing the integration. Reference the `integrations` skill if necessary. You are required to ensure these requirements are met before setting up or using RevenueCat. ## Project Structure - **Scripts directory**: The `@workspace/scripts` monorepo package (e.g., `src/seedRevenueCat.ts`) - **Run a script**: `pnpm --filter @workspace/scripts exec tsx src/