diff --git a/packages/docs/index.html b/packages/docs/index.html index e571854e..3275b3d3 100644 --- a/packages/docs/index.html +++ b/packages/docs/index.html @@ -10,7 +10,7 @@
diff --git a/packages/docs/src/pages/docs/apis/index.tsx b/packages/docs/src/pages/docs/apis/index.tsx index 69751437..ad26903e 100644 --- a/packages/docs/src/pages/docs/apis/index.tsx +++ b/packages/docs/src/pages/docs/apis/index.tsx @@ -98,9 +98,9 @@ function APIsIndex() {
diff --git a/packages/docs/src/pages/docs/ecosystem.tsx b/packages/docs/src/pages/docs/ecosystem.tsx index 8590f12b..27c32161 100644 --- a/packages/docs/src/pages/docs/ecosystem.tsx +++ b/packages/docs/src/pages/docs/ecosystem.tsx @@ -10,8 +10,9 @@ function Ecosystem() {
diff --git a/packages/docs/src/pages/docs/errors.tsx b/packages/docs/src/pages/docs/errors.tsx index 512d997f..567fdea7 100644 --- a/packages/docs/src/pages/docs/errors.tsx +++ b/packages/docs/src/pages/docs/errors.tsx @@ -12,9 +12,9 @@ function Errors() {
diff --git a/packages/docs/src/pages/docs/types/index.tsx b/packages/docs/src/pages/docs/types/index.tsx index 74e392f9..03e9c464 100644 --- a/packages/docs/src/pages/docs/types/index.tsx +++ b/packages/docs/src/pages/docs/types/index.tsx @@ -231,9 +231,9 @@ function TypesIndex() {
- Unifying fragmented IAP implementations across platforms, - frameworks, and emerging technologies + Stop rewriting IAP code for every platform. One API for iOS, + Android, Vision Pro, and Meta Quest.
+ {/* Quick Stats */} ++ Build revenue-generating features faster with less code +
++ Master one API instead of learning different patterns for iOS, + Android, and every framework +
++ Type-safe generated code catches mistakes at compile time, not + in production +
++ Full access to StoreKit 2 and Play Billing v8 — no features + hidden or abstracted away +
+- Horizon OS, Android XR, Vision Pro - new realities need - purchases. OpenIAP is ready for the spatial computing era. + Horizon OS and Vision Pro supported. Android XR coming soon. + OpenIAP is ready for the spatial computing era.
- OpenIAP is an open specification that standardizes in-app purchase - implementations across diverse platforms and frameworks. As the IAP - ecosystem becomes increasingly fragmented with new platforms - (StoreKit 2, Android Billing v8, Vision Pro, Horizon OS) and - frameworks (React Native, Flutter, KMP), OpenIAP provides a unified - specification that reduces complexity and ensures consistency. -
-+ OpenIAP is a unified specification for in-app purchases across iOS, + Android, and XR platforms. One GraphQL schema generates type-safe + native code for Swift, Kotlin, TypeScript, Dart, and GDScript. +
+ {/* The Problem */}- Every new platform and framework creates its own IAP implementation. - Library maintainers independently design APIs, leading to fragmented - specifications. Developers must learn different APIs for each - platform, increasing complexity and errors. As new technologies - emerge - XR platforms, cross-platform frameworks, and emerging - payment systems - this fragmentation only grows worse. +
+ In-app purchase implementations are fragmented across platforms and + frameworks. Each library defines its own API surface, type + definitions, and event patterns. This creates several challenges:
-- In the AI coding era, this fragmentation becomes even more - problematic. AI assistants struggle to generate consistent code when - every library has different patterns, making IAP implementation - unnecessarily complex and error-prone. +
react-native-iap, flutter_inapp_purchase
+ , and other libraries
+ + New platforms like{' '} + + Vision Pro + {' '} + and Horizon OS compound this + fragmentation.
- OpenIAP defines standard methods like initConnection(),{' '}
- fetchProducts(),requestPurchase(), and{' '}
- finishTransaction() that work consistently across all
- platforms. Library maintainers implement these standard APIs,
- ensuring developers have a consistent experience.
+
+ OpenIAP provides a single source of truth for IAP implementations. + The specification defines:
- -
- Event handling is standardized with patterns like{' '}
- purchaseUpdatedListener and
- purchaseErrorListener. No more platform-specific event
- names or handling patterns - just consistent, predictable events
- across all implementations.
-
- Common data structures like Product,{' '}
- Purchase, and PurchaseError
- are defined once and used everywhere. This ensures type safety and
- reduces the cognitive load on developers switching between
- platforms.
-
initConnection()
+
+ ,{' '}
+
+ fetchProducts()
+
+ ,{' '}
+
+ requestPurchase()
+
+ ,{' '}
+
+ finishTransaction()
+
Product
+
+ ,{' '}
+
+ Purchase
+
+ ,{' '}
+
+ SubscriptionPeriod
+
+ ,{' '}
+
+ PurchaseError
+
purchaseUpdatedListener
+
+ ,{' '}
+
+ purchaseErrorListener
+
IOS/
+ Android suffix
- Leading IAP libraries are already implementing the OpenIAP - specification: +
+ OpenIAP uses a schema-driven approach. A single GraphQL schema + defines all types and operations, which are then generated into + native code for each target platform.
-
+
+ + View ecosystem documentation → +
+
+ The{' '}
+
+ openiap-gql
+ {' '}
+ package contains the GraphQL schema and generators. Running{' '}
+ bun run generate produces:
+
+ {`packages/apple/Sources/Models/Types.swift # Swift types
+packages/google/openiap/src/main/Types.kt # Kotlin types
+src/generated/types.ts # TypeScript types
+src/generated/types.dart # Dart types
+src/generated/types.gd # GDScript types`}
+
+ + Two native modules implement the specification on top of platform + APIs: +
++ Swift module built on{' '} - expo-iap + StoreKit 2 - : - {' '} - React Native & Expo implementation (Expo Modules) -
+ Kotlin module built on{' '} - kmp-iap + Play Billing v8 - : - {' '} - Kotlin Multiplatform implementation -
- These libraries demonstrate that OpenIAP's unified approach works in - practice, providing consistent APIs while leveraging - platform-specific capabilities. + . Supports Android 5.0+ (API 21+). +
++ OpenIAP uses consistent naming across all implementations: +
+| Scope | +Pattern | +Example | +
|---|---|---|
| Cross-platform | +
+ functionName
+ |
+
+ fetchProducts(), requestPurchase()
+ |
+
| iOS-only | +
+ functionNameIOS
+ |
+
+ syncIOS(), getStorefrontIOS()
+ |
+
| Android-only | +
+ functionNameAndroid
+ |
+
+ acknowledgePurchaseAndroid()
+ |
+
+ Generated types ensure compile-time safety. Platform-specific fields + use suffixes to prevent accidental cross-platform usage: +
++ The standard purchase flow works identically across all OpenIAP + implementations: +
++ See Purchase Lifecycle for + detailed flow documentation. +
+| Platform | +Billing API | +Min Version | +
|---|---|---|
| iOS | ++ + StoreKit 2 + + | +iOS 15.0+ | +
| macOS | +StoreKit 2 | +macOS 12.0+ | +
| visionOS | +StoreKit 2 | +visionOS 1.0+ | +
| Android | ++ + Play Billing v8 + + | +API 21+ (5.0) | +
| Meta Quest | ++ Horizon OS + | +Quest 2+ | +
+ Production-ready libraries implementing the OpenIAP specification: +
+| Library | +Framework | +Bridge | +
|---|---|---|
| + + react-native-iap + + | +React Native | ++ + Nitro Modules + + | +
| + + expo-iap + + | +Expo | ++ + Expo Modules + + | +
| + + flutter_inapp_purchase + + | +Flutter | ++ + Pigeon + + | +
| + + kmp-iap + + | +Kotlin Multiplatform | ++ + K/N Interop + + | +
| + + godot-iap + + | +Godot 4.x | ++ + GDExtension + + | +
+ View all implementations → +
++ Choose your framework to get started:
+Core methods and patterns
+ + + Type Definitions +Generated types for all languages
+ + + Purchase Lifecycle +Transaction flow diagrams
+ + + Tutorials +Step-by-step guides
+ +