Skip to content
Docs
Changelog

purchases

Native purchase coordination: responsibilities, supported exports and extension points.

Markdown

Purpose

A vendor-neutral interface wraps the optional RevenueCat SDK. Configuration, connection and identity changes serialize SDK operations. A generation guard prevents stale identity results from updating the current customer state. Purchase and restore resolve to a StoreResult: the CustomerInfo, or a reason mapped from the SDK's error codes (cancelled, pending, not allowed, already owned, another account, network, failed, unavailable). onCustomerInfoChange forwards the SDK's updates while a confirmed user is connected, and manageSubscriptions opens the store's subscription settings. React hooks expose customer and entitlement state.

Public exports

SubpathTarget
../src/index.ts
./react./src/react.ts

These paths come from packages/purchases/package.json. A . entry is the package root. Conditional targets distinguish platform or type resolution; consumers should import the subpath, not its source file.

How to extend

Register the supported SDK, connect the signed-in user for the whole session (not one screen) and disconnect on sign-out; keep identity changes inside the package. Client purchase state is presentation; server-verified Paid Access remains authoritative.

Read Payments for the model and Mobile subscriptions with RevenueCat for the setup.

Key files

Edit on GitHubDocumentation is in English.
Cookie settings
We use essential cookies to make our app work. With your consent, we also use optional cookies to improve your experience.

Read our Cookie Policy and Privacy Policy.