npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-iap

v14.6.2

Published

React Native In-App Purchases module for iOS and Android using Nitro

Downloads

253,703

Readme

React Native IAP

Version Download 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.

🎨 Promotion

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)

  • [email protected] (Nitro) requires React Native 0.79+.
  • Stuck on RN 0.75.x or lower? Use the last pre‑Nitro version: npm i [email protected].
  • 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.1.20"
          }
        }
      ]
    ]
  }
}

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:

🎯 What's Next?

📖 Visit our comprehensive documentation site →

Key Resources

Sponsors

💼 View Our Sponsors

Angel

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.