Guidelines for using RevenueCat to integrate payments in mobile apps and any subsequent CRUD operations related to any RevenueCat entities
react-native-purchases. Always download the version that is compatible with the version of React Native/Expo used in the app.These packages must be installed in the workspace root package.json:
react-native-purchases - Official client-side SDK for React Native. This should be used on the client.@replit/revenuecat-sdk - SDK for RevenueCat's REST API. This should NEVER be used on the client, only for server-side scripts.Do not install them in any workspace package. If they are not installed, use pnpm to install them via the following command: $ cd /home/runner/workspace && pnpm add -w <packages>
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.
@workspace/scripts monorepo package (e.g., src/seedRevenueCat.ts)pnpm --filter @workspace/scripts exec tsx src/<script>.tsReference files use these terms. Map them to these concrete paths.
offerings.current on the client for the default offering.
Do NOT Create Product Tables or Maintain Any Other Source of Truth for In-App Purchases
Bad — creates duplicate product storage:
export const products = pgTable("products", {
id: varchar("id").primaryKey(),
name: text("name"),
price: integer("price"),
// ... custom fields
});
Correct Approach:
Key Principle "If it exists in RevenueCat, it belongs in RevenueCat"
Before writing code, identify whether any reference below applies to the task. If it does, read it first.
@replit/revenuecat-sdk package