@baukit/purchases-revenuecat
v0.13.0
Published
Optional react-native-purchases adapter for @baukit/purchases-core that identifies RevenueCat customers by suite subject.
Readme
@baukit/purchases-revenuecat
The react-native-purchases implementation of the @baukit/purchases-core port. It imports only types from react-native-purchases. The app passes the module in.
import Purchases from 'react-native-purchases';
import { createRevenueCatPurchasesPort } from '@baukit/purchases-revenuecat';
const port = createRevenueCatPurchasesPort(Purchases, { apiKey: platformApiKey });- The factory calls
Purchases.configure({ apiKey })once and throwsunavailablefor an empty key. UsecreateNoopPurchasesPort()when the build has no key. identifycallslogInwith the suite subject<identity_domain>|<hub sub>. The hub resolves RevenueCat webhooks against that string.resetcallslogOutunless the user is already anonymous.offeringsmaps RevenueCat offerings. Offering and product IDs come from the RevenueCat dashboard and app configuration.NON_SUBSCRIPTIONproducts becomeone_timepackages for credit packs.- RevenueCat error codes map to
cancelled,pending,networkorstore.
react-native-purchases 10.14.0 or later is a peer dependency. It needs no Expo config plugin. Expo Go has no store access, so use a development build.
