Skip to main content
Version: 14.5 (Current)

React Native IAP

GreatFrontEnd

React Native IAP is a powerful in-app purchase solution for Expo and React Native applications that conforms to the Open IAP specification. It provides a unified API for handling in-app purchases across iOS and Android platforms with comprehensive error handling and modern TypeScript support.

If you're shipping an app with react-native-iap, we’d love to hear about it—please share your product and feedback in Who’s using React Native IAP?. Community stories help us keep improving the ecosystem.

Promotion

kstyled Logo

Compile-time CSS-in-JS for React Native

✨ Banishing runtime overhead, one style at a time with kstyled - fully type-safe styling that compiles away.

🚀 Explore kstyled →

Sponsors & Community Support

We're building the OpenIAP ecosystem—defining the spec at openiap.dev, maintaining openiap for the shared type system, and shipping native SDKs such as openiap Apple and openiap Google. These modules power react-native-iap, flutter_inapp_purchase, kmp-iap, and react-native-iap. After simplifying fragmented APIs, the next milestone is a streamlined purchase flow: initConnection → fetchProducts → requestPurchase → (server receipt validation) → finishTransaction.

Your sponsorship keeps this work moving—ensuring more developers across platforms, OS, and frameworks can implement IAPs without headaches while we expand to additional plugins and payment systems. Sponsors receive shout-outs in each release and, depending on tier, can request tailored support. If you’re interested—or have rollout feedback to share—you can view sponsorship options at openiap.dev/sponsors.

📚 Guides

🚀 Quick Start

Installation

Install the package using your favorite package manager:

npm install react-native-iap react-native-nitro-modules
Nitro Modules Dependency

Starting from v14.4.0, react-native-iap uses Nitro Modules for native bridging. For more details, see the announcement discussion.

Basic Usage

import {useIAP, ErrorCode} from 'react-native-iap';

const {connected, products, fetchProducts, requestPurchase, finishTransaction} =
useIAP({
onPurchaseSuccess: async (purchase) => {
// Validate on your server, then finish
await finishTransaction({purchase, isConsumable: true});
},
onPurchaseError: (error) => {
if (error.code !== ErrorCode.UserCancelled) {
console.error('Purchase error:', error.message);
}
},
});

// Fetch products when connected
useEffect(() => {
if (connected) {
fetchProducts({skus: ['product_id'], type: 'in-app'});
}
}, [connected]);

// Purchase (platform-specific)
await requestPurchase({
request: {
apple: {sku: 'product_id'},
google: {skus: ['product_id']},
},
type: 'in-app',
});

For complete examples, see Purchase Flow and Subscription Flow.

🏗️ Architecture

React Native IAP is built with a modern architecture that emphasizes:

  • Type Safety: Comprehensive TypeScript definitions for all APIs
  • Error Resilience: Centralized error handling with meaningful error codes
  • Platform Abstraction: Unified API that handles platform differences internally
  • Performance: Optimized for minimal bundle size and runtime performance

📱 Platform Support

PlatformSupportNotes
iOSStoreKit 1 & 2 (StoreKit 2 requires iOS 15+)
AndroidGoogle Play Billing v5+
Expo Go⚠️Limited (requires custom development client)
Expo Dev ClientFull support
Bare React NativeFull support

🎯 What's Next?

📦 Setup & Configuration

🔧 Implementation

📚 Guides

🛠️ Advanced Topics

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.