Back to rankings

hyochan/react-native-iap

TypeScripthyochan.github.io/react-native-iap

In App Purchase module for React Native that confirms OpenIAP

react-nativeamazonandroidappstorebillingiapin-app-purchaseiosplaystorereact-native-iapopeniap
Star Growth
Stars
3.2k
Forks
694
Weekly Growth
โ€”
Issues
14
1k2k3k
Oct 2017Sep 2020Aug 2023Jul 2026
Artifactsnpmnpm install react-native-iap
README

โš ๏ธ This repository has moved to the OpenIAP monorepo. This repository is deprecated and will be archived soon. All future development happens in the monorepo. See the ๐Ÿ“ข announcement issue or the discussion thread for details.

React Native IAP

React Native IAP Logo

Version Download OpenIAP Backers and Sponsors CI - Test codecov FOSSA Status

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.

Open IAP

๐ŸŽจ 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 โ†’

๐Ÿ“š 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://hyochan.github.io/react-native-iap/docs/installation#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
  • ๐Ÿ“ฑ 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

๐Ÿš€ 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 v8.0.0+
Expo Go โŒ Not supported (requires native modules)
Expo Dev Client โœ… Full support
Bare React Native โœ… Full support

๐Ÿ“ฆ Installation & Configuration

Prerequisites

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

Post Installation

Android Configuration

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"
    }
}

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 Configuration

For Expo projects, add the plugin to your app.json or expo.json:

{
  "expo": {
    "plugins": [
      "react-native-iap",
      [
        "expo-build-properties",
        {
          "android": {
            "kotlinVersion": "2.2.0"
          }
        }
      ]
    ]
  }
}

Note: Expo projects require development build (dev-client) as this library contains native code.

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 specification โ€” 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, Dart, and GDScript from a single GraphQL schema
  • Platform implementations โ€” openiap-apple (StoreKit 2) and openiap-google (Play Billing 8.x)
  • Verification profiles โ€” Standardized receipt validation and purchase verification patterns

Other libraries built on OpenIAP: expo-iap ยท flutter_inapp_purchase ยท kmp-iap ยท godot-iap

Learn more about the OpenIAP standard โ†’

Sponsors

๐Ÿ’ผ View Our Sponsors

Angel

courier_dot_com

Past Supporters

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Buy me a coffee.


OpenCollective Sponsorship

We also manage sponsorships through OpenCollective, which operates separately from our main sponsor program.

Sponsors:

Backers:

Become a sponsor | Become a backer

Contributing

See our Contributing Guide for development setup and guidelines.

Related repositories
react/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
126.2k25.2k
facebook/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
120.9k24.5k
justjavac/free-programming-books-zh_CN

:books: ๅ…่ดน็š„่ฎก็ฎ—ๆœบ็ผ–็จ‹็ฑปไธญๆ–‡ไนฆ็ฑ๏ผŒๆฌข่ฟŽๆŠ•็จฟ

GNU General Public License v3.0pythonjavascript
weibo.com/justjavac
117.7k28.2k
storybookjs/storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation

TypeScriptnpmMIT Licensestorybookstyleguide
storybook.js.org
90.6k10.2k
enaqx/awesome-react

A collection of awesome things regarding React ecosystem

reactreact-native
74k7.6k
appwrite/appwrite

Appwriteยฎ - complete cloud infrastructure for your web, mobile and AI apps. Including Auth, Databases, Storage, Functions, Messaging, Hosting, Realtime and more

TypeScriptnpmBSD 3-Clause "New" or "Revised" Licenseappwritedocker
appwrite.io
56.6k5.6k
laurent22/joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.

TypeScriptnpmOtherreact-nativenodejs
joplinapp.org
55.7k6.2k
dkhamsing/open-source-ios-apps

:iphone: Collaborative List of Open-Source iOS Apps

Creative Commons Zero v1.0 Universaliosswift
51.3k6k
expo/expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

TypeScriptnpmMIT Licensemobileexpo
docs.expo.dev
50.9k13.1k
react-hook-form/react-hook-form

๐Ÿ“‹ React Hooks for form state management and validation (Web + React Native)

TypeScriptnpmMIT Licensetypescriptreact-hooks
react-hook-form.com
44.8k2.5k
sudheerj/reactjs-interview-questions

List of top 500 ReactJS Interview Questions & Answers....Coding exercise questions are coming soon!!

JavaScriptnpmMIT Licensereactjsreact-router
44.7k10.4k
mattermost/mattermost

Mattermost is an open source platform for secure collaboration across the entire software development lifecycle..

TypeScriptnpmOthercollaborationmattermost
mattermost.com
38.5k8.9k