Skip to main content
Version: 14.6

React Native IAP

This repository has moved

react-native-iap now lives in the OpenIAP monorepo — the source is at libraries/react-native-iap and the npm package name is unchanged. The current documentation lives at openiap.dev/docs/setup/react-native. Please report issues and feature requests at hyodotdev/openiap/issues.

IapKit - In-App Purchase Validation Service

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.

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
iOS✅StoreKit 1 & 2 (StoreKit 2 requires iOS 15+)
Android✅Google Play Billing v5+
Expo Go⚠️Limited (requires custom development client)
Expo Dev Client✅Full support
Bare React Native✅Full 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.