Revenuecat
Native RevenueCat integration for Godot Engine with full support for iOS and Android
Install / Use
/learn @godot-x/RevenuecatREADME
Godotx RevenueCat
Native RevenueCat integration for Godot Engine with full support for iOS and Android.
Table of Contents
- Overview
- Quick Start
- Usage Examples
- Advanced Configuration
- Building (For Developers)
- Project Structure
- Development Guide
- Troubleshooting
- API Reference
- FAQ
- Contributing
- Screenshot
- License
Overview
This project provides a native RevenueCat plugin for Godot, built as a fully integrated purchase and subscription management system using the official RevenueCat SDK. The plugin is shipped as native libraries for iOS (.xcframework) and Android (.aar) and automatically managed through the Godot Export Pipeline.
Key Features
- 💰 Purchases & Subscriptions – Easily handle consumables, non‑consumables, and subscription products
- 🧩 Entitlements & Customer Info – Query whether a user is premium and access entitlement statuses
- 📦 Offerings & Products – Retrieve RevenueCat products dynamically and build custom paywalls
- 🧱 Native Paywall UI – Show RevenueCat UI using
present_paywall(iOS + Android) - 🔑 User Authentication – Login, logout, restore purchases and support cross‑platform accounts
Version Information
| Component | Version | |-----------|---------| | Godot | 4.6‑stable | | RevenueCat iOS SDK | 5.56.0 | | RevenueCat Android SDK | 9.19.4 | | Kotlin | 2.3.0 | | Min iOS | 15.0 | | Min Android SDK | 24 (Android 7.0) |
Quick Start
1. Installation
Option A: Godot Asset Library (Recommended)
- Open AssetLib in Godot Editor
- Search for "Godotx RevenueCat"
- Click Download and Install
- Or download directly from: https://godotengine.org/asset-library/asset/4493
Option B: Manual Installation
-
Download the ZIP from Releases
-
Extract the ZIP - it contains 3 folders:
godotx_revenuecat/ ├── addons/ ├── ios/ └── android/ -
Copy all 3 folders to your Godot project root:
your_project/ ├── addons/ │ └── godotx_revenue_cat/ ├── ios/ │ └── plugins/ │ └── revenuecat/ └── android/ └── revenuecat/ -
Enable the plugin in Godot:
- Open Project → Project Settings → Plugins
- Enable "Godotx RevenueCat"
2. Configure Export Preset
Android
-
Install Android Build Template
Project → Install Android Build Template -
In the export menu, set:
- ✔ Use Gradle Build
- ✔ Enable GodotxRevenueCat in plugins list
iOS
Enable plugin under export → iOS plugins list.
Usage Examples
Initialization
extends Node
var revenuecat
func _ready():
if Engine.has_singleton("GodotxRevenueCat"):
revenuecat = Engine.get_singleton("GodotxRevenueCat")
# Signals
revenuecat.customer_info_changed.connect(_on_customer_info_changed)
revenuecat.purchase_result.connect(_on_purchase_result)
var api_key = OS.get_name() == "iOS" ? "appl_xxx" : "goog_xxx"
revenuecat.initialize(api_key, "", true)
func _on_customer_info_changed(data):
print("Customer info updated: ", data)
func _on_purchase_result(data):
print("Purchase result: ", data)
Fetching Products & Offerings
# Offerings
revenuecat.fetch_offerings()
# Products (for custom UI)
revenuecat.products.connect(_on_products_received)
revenuecat.fetch_products(["premium_monthly", "premium_yearly"])
func _on_products_received(data: Dictionary):
var error = data.get("error", "")
if error != "":
print("Error: ", error)
return
var raw_products = data.get("products", null)
if raw_products == null:
return
var products_list: Array = []
# ios - native array
if raw_products is Array:
products_list = raw_products
# android - array list
elif raw_products is JavaObject:
var count: int = raw_products.call("size")
for i in range(count):
products_list.append(raw_products.call("get", i))
# process products
for product in products_list:
print("ID: ", product["id"])
print("Title: ", product["title"])
print("Price: ", product["price"])
Purchases Flows
revenuecat.purchase("premium_monthly")
revenuecat.restore_purchases()
Show Native Paywall
revenuecat.present_paywall("default")
Entitlements
revenuecat.is_subscriber()
revenuecat.has_entitlement("premium_access")
revenuecat.check_entitlement("premium_access")
Login & Logout
revenuecat.login("user_123")
revenuecat.logout()
Advanced Configuration
Android R8/ProGuard Minification
By default, R8 minification is disabled in release builds. If you want to enable it for smaller APK/AAB sizes, follow these steps:
-
Edit
android/build/build.gradleand enable minification in the release build type:android { buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } -
Create
android/build/proguard-rules.prowith the following content:#################################### # Godot JNI #################################### -keep class org.godotengine.godot.** { *; } -dontwarn org.godotengine.godot.**
Important Notes:
- RevenueCat ProGuard rules are already included in the module (via
consumerProguardFiles) - Only add custom rules if you encounter issues with other libraries
- Test thoroughly after enabling minification to ensure everything works correctly
Building (For Developers)
make setup # Downloads SDKs & prepares build
make build-all # Builds everything
make build-apple # Build only iOS
make build-android # Build only Android
make clean # Full cleanup
Project Structure
revenuecat/
├── addons/godotx_revenue_cat/ # Godot plugin
│ ├── export_plugin.gd
│ └── plugin.cfg
│
├── source/ # Native source
│ ├── ios/
│ └── android/
│
├── ios/plugins/ # Built output (.xcframework)
├── android/ # Built output (.aar)
└── scenes/Main.tscn # Test scene
API Reference
Methods
| Method | Description |
|--------|-------------|
| initialize(api_key, user_id, debug) | Initializes SDK |
| fetch_offerings() | Retrieves offerings |
| fetch_products(ids) | Retrieves product details |
| purchase(id) | Starts purchase flow |
| login(user_id) | Authenticate user |
| logout() | Anonymous reset |
| is_subscriber() | Returns subscription state |
| has_entitlement(id) | Returns if has entitlement |
| present_paywall(offering) | Shows native UI |
| check_entitlement(id) | Checks entitlement |
| restore_purchases | Retrieves purchases |
Signals
| Signal | Args | Description |
|--------|------|-------------|
| customer_info_changed | data: Dictionary | On customer update |
| purchase_result | data: Dictionary | On purchase finish |
| offerings | data: Dictionary | Offerings received |
| products | data: Dictionary | Products received |
| login_finished | data: Dictionary | Login status |
| logout_finished | data: Dictionary | Logout |
| subscriber | value: bool | Subscription flag |
| entitlement | id, active | Entitlement result |
| paywall_result | data: Dictionary | Paywall close |
| restore_finished | data: Dictionary | Restore result |
FAQ
Q: Do I need separate keys for Android/iOS?
Yes — use appl_ for iOS and goog_ for Android.
Contributing
Contributions are welcome! Here's how you can help:
- Report bugs: Open an issue with reproduction steps
- Request features: Suggest new features or improvements
- Submit PRs:
- Follow existing code style
- Test on both iOS and Android
- Update documentation as needed
Project Conventions
- iOS: Objective-C++ for Godot integration
- Android: Kotlin for plugin implementation
- Naming:
GodotxRevenueCatfor singleton names - Signals: Use snake_case (e.g.,
purchase_result,initialized) - Methods: Use snake_case following GDScript conventions
Screenshot
<img width="300" src="extras/images/screenshot.png" alt="Screenshot">License
MIT License - See LICENSE
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤️ by Paulo Coutinho
Related Skills
openhue
351.4kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
351.4kElevenLabs text-to-speech with mac-style say UX.
weather
351.4kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.6kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
