React Native IAP is a high-performance in-app purchase library using Nitro Modules 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.
π Visit our comprehensive documentation site β
Starting from version 14.0.0, this library uses Nitro Modules for high-performance native bridge implementation. You must install react-native-nitro-modules alongside react-native-iap.
react-native-iap@14.x(Nitro) requires React Native 0.79+.- Stuck on RN 0.75.x or lower? Use the last preβNitro version:
npm i react-native-iap@13.1.0. - Seeing Swift 6 C++ interop errors in Nitro (e.g.,
AnyMap.swiftwithcppPart.pointee.*)? Temporarily pin Swift to 5.10 for theNitroModulespod (see Installation docs) or upgrade RN and Nitro deps. - Recommended: upgrade to RN 0.79+, update
react-native-nitro-modules/nitro-codegen, thenpod installand clean build.
More details and the Podfile snippet are in the docs: https://hyochan.github.io/react-native-iap/docs/installation#ios
- π Cross-platform Support: Works seamlessly on both iOS and Android
- β‘ Nitro Modules: High-performance native bridge with minimal overhead
- π― TypeScript First: Full TypeScript support with comprehensive type definitions
- π‘οΈ Centralized Error Handling: Unified error management with platform-specific error code mapping
- π£ React Hooks: Modern React hooks API with
useIAP - π± Expo Compatible: Works with Expo development builds
- π Receipt Validation: Built-in receipt validation for both platforms
- π Products & Subscriptions: Support for both one-time purchases and subscriptions
- π Performance Optimized: Efficient caching and minimal re-renders
npm install react-native-iap react-native-nitro-modules
# or
yarn add react-native-iap react-native-nitro-modulesπ See the complete installation guide and quick start tutorial β
React Native IAP is built with a modern architecture that emphasizes:
- Nitro Modules: High-performance native bridge with C++ core and platform-specific implementations
- 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 | Notes |
|---|---|---|
| iOS | β | StoreKit 2 (requires iOS 15+) |
| Android | β | Google Play Billing v8.0.0+ |
| Expo Go | β | Not supported (requires native modules) |
| Expo Dev Client | β | Full support |
| Bare React Native | β | Full support |
Before installing React Native IAP, make sure you have:
- React Native 0.64 or later, or Expo SDK 45 or later
- Node.js 16 or later
- iOS 15+ for iOS apps (StoreKit 2 requirement)
- Android API level 21+ for Android apps
Kotlin Version Requirement: This library requires Kotlin 2.0+. Configure your project's Kotlin version:
In your root android/build.gradle:
buildscript {
ext {
kotlinVersion = "2.1.20"
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}-
Install pods:
cd ios && pod install
-
Add StoreKit capability to your iOS app in Xcode:
- Open your project in Xcode
- Select your app target
- Go to "Signing & Capabilities"
- Click "+ Capability" and add "In-App Purchase"
For Expo projects, add the plugin to your app.json or expo.json:
{
"expo": {
"plugins": [
"react-native-iap",
[
"expo-build-properties",
{
"android": {
"kotlinVersion": "2.1.20"
}
}
]
]
}
}Note: Expo projects require development build (dev-client) as this library contains native code.
React Native IAP is OpenIAP compliant. For detailed store configuration:
- iOS Setup β - App Store Connect configuration
- Android Setup β - Google Play Console configuration
π Visit our comprehensive documentation site β
- Installation & Quick Start - Get started in minutes
- API Reference - Complete useIAP hook documentation
- Examples - Production-ready implementations
- Error Handling - OpenIAP compliant error codes
- Troubleshooting - Common issues and solutions
πΌ View Our Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Buy me a coffee.
We also manage sponsorships through OpenCollective, which operates separately from our main sponsor program.
Become a sponsor | Become a backer
See our Contributing Guide for development setup and guidelines.