Skip to content

Latest commit

 

History

History

react-native-iap

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

React Native IAP

React Native IAP Logo

Version Download OpenIAP CI - Test codecov FOSSA Status

React Native IAP is a high-performance in-app purchase library using Nitro Modules that conforms to the OpenIAP Client Protocol. It provides a unified API for handling in-app purchases across iOS and Android platforms with comprehensive error handling and modern TypeScript support.

OpenIAP

📚 Documentation

📖 Visit our comprehensive documentation site →

⚠️ Notice

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.

Compatibility (Nitro 14.x)

  • 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.swift with cppPart.pointee.*)? Temporarily pin Swift to 5.10 for the NitroModules pod (see Installation docs) or upgrade RN and Nitro deps.
  • Recommended: upgrade to RN 0.79+, update react-native-nitro-modules/nitro-codegen, then pod install and clean build.

More details and the Podfile snippet are in the docs: https://openiap.dev/docs/setup/react-native#ios

✨ Features

  • 🔄 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
  • 📱 React Native Focused: Use expo-iap for Expo projects
  • 🔍 Purchase Verification: Verify purchases with your backend or a verification service such as IAPKit before granting access
  • 💎 Products & Subscriptions: Support for both one-time purchases and subscriptions
  • 🚀 Performance Optimized: Efficient caching and minimal re-renders

🚀 Quick Start

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 →

🏗️ Architecture

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

Platform Support Notes
iOS ✅ StoreKit 2 (requires iOS 15+)
Android ✅ Google Play Billing v9.1.0
Expo Go ❌ Cannot load custom native modules
Expo Dev Client ❌ Use expo-iap in an Expo development build
Bare React Native ✅ Full support

For Expo projects, use expo-iap in a native development build (with or without expo-dev-client). Neither library runs in Expo Go. react-native-iap reports this when you initialize it in Expo Go.

📦 Installation & Configuration

Prerequisites

Before installing React Native IAP, make sure you have:

  • React Native 0.79 or later
  • Node.js 18 or later (and any higher minimum required by your React Native version)
  • iOS 15+ for iOS apps (StoreKit 2 requirement)
  • Android API level 23+ for the library (and any higher minimum required by React Native)
  • Kotlin 2.1.20 or later for Android builds

Post Installation

Android Configuration

Kotlin compatibility: React Native IAP uses the Kotlin and Android Gradle Plugin versions supplied by the host React Native project. Published OpenIAP Android artifacts are validated against Kotlin 2.1.20, while the standalone source-build fallback is Kotlin 2.2.0. React Native 0.79 projects that still use Kotlin 2.0.21 must upgrade their Android Kotlin plugin; newer React Native releases should keep their supplied compiler version.

iOS Configuration

  1. Install pods:

    cd ios && pod install
  2. 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"

Expo Projects

Use expo-iap for Expo apps. This package targets bare React Native/Nitro projects.

Store Configuration

React Native IAP is OpenIAP compliant. For detailed store configuration:

🤖 Using with AI Assistants

React Native IAP provides AI-friendly documentation for Cursor, GitHub Copilot, Claude, and ChatGPT.

📖 AI Assistants Guide →

Quick links:

🎯 What's Next?

📖 Visit our comprehensive documentation site →

Key Resources

Powered by OpenIAP

OpenIAP

React Native IAP conforms to the OpenIAP Client Protocol — an open, vendor-neutral interoperability standard for in-app purchases. OpenIAP provides:

  • Shared specification — Common types, error codes, and purchase flows across all platforms
  • Generated type-safe bindings — Swift, Kotlin, TypeScript, Dart, C#, and GDScript from a single GraphQL schema
  • Platform implementations — openiap-apple (StoreKit 2) and openiap-google (Play Billing 9.1.0)
  • Verification profiles — Standardized receipt validation and purchase verification patterns

Other libraries built on OpenIAP: expo-iap · flutter_inapp_purchase · kmp-iap · maui-iap · godot-iap

Learn more about the OpenIAP standard →

Built something with react-native-iap?

List your app on the OpenIAP showcase.

Questions and feedback go to Discussions.

If react-native-iap saves you time, a ⭐ on hyodotdev/openiap helps.

Sponsors

Meta        Amazon Developer

Thank you to Meta and Amazon Developer for supporting OpenIAP. View sponsorship options.

In-kind support

Claude

Claude for Open Source provides the Claude Ultra plan for the maintainer from July 20, 2026 to January 19, 2027.

OpenCollective

We also recognize sponsors and backers through OpenCollective. The original react-native-iap collective now supports the broader OpenIAP ecosystem and is managed separately from the main sponsor program.

Sponsors: OpenCollective sponsors

Backers: OpenCollective backers

Become a sponsor | Become a backer

Past supporters

Supported the project before the OpenIAP sponsor program: Nami for 30 months and Courier for 1 month.

Nami      Courier

Community

For bug reports, please open an issue.

Contributing

react-native-iap contributors

Thank you to everyone who contributed to hyochan/react-native-iap, the community where OpenIAP began.

See our Contributing Guide for development setup and guidelines.