@usercentrics/react-native-sdk
v2.25.1
Published
Usercentrics SDK
Maintainers
Keywords
Readme
Usercentrics
Already a customer?
In case you wish to report an issue, we provide a dedicated page specifically for this purpose. By accessing the provided link and submitting a ticket our team will address your concerns with the utmost efficiency, ensuring a prompt resolution.
Welcome!
You are now one step closer to make privacy a core feature in your application. We are very happy that you decided to make this a priority. We are here to help you build trust with your users.
The Usercentrics Apps SDK
The Usercentrics Apps SDK is a native Consent Management Platform solution for mobile apps, mobile games & TV applications, that enables the collection, documentation, and management of your user's privacy choices, in order to ensure legal compliance for legal regulations around the world.
📋 Requirements
Mobile Platforms
- Android 7.0 (API 24) or higher
- iOS 11 or higher
Development Environment
- Node.js 18.0+ (LTS recommended)
- npm 9.0+ or Yarn 1.22+
- TypeScript 5.1+
- React 18.2+ (React 19 supported)
- React Native 0.74.3+ (with Fabric support)
Android Development
- Java 17+ (OpenJDK or Oracle JDK)
- Android SDK with API 34+ platforms
- Android NDK 25+
- Gradle 8.2+ (Gradle 8.13 used)
- Kotlin 1.9.22+ (Kotlin 2.0.21 recommended)
- Android Gradle Plugin 8.2+
iOS Development (macOS only)
- Xcode 15.0+ with iOS SDK
- CocoaPods 1.12+
- iOS Simulators (recommended)
Optional but Recommended
- Watchman (for better file watching)
- Git (for version control)
- SDKMan (for Java version management)
Get started!
In order to use and test the SDK, you will need a Usercentrics Account. Get started with a free trial.
Integration
Continue to our documentation for a step by step integration guide.
Example
See the example directory for a complete sample app using Usercentrics.
Quick Start
🚀 Automated Setup (Recommended)
The easiest way to get started is using our automated setup script:
# Check your development environment
npm run check-requirements
# Automatically install missing dependencies
npm run auto-setup
# Verify everything is ready
npm run check-requirements📱 Running the Sample Project
Option 1: Using Helper Scripts
# Install all dependencies
npm run install-dependencies
# Run Android app
npm run run-android
# Run iOS app (macOS only)
npm run iosOption 2: Manual Setup
- From root folder:
npm install --legacy-peer-deps - From example folder:
npm install --legacy-peer-deps
iOS (macOS only)
From example folder:
npx pod-install
npx react-native run-iosAndroid
Make sure you have Android SDK configured, then from example folder:
npx react-native run-android🛠️ Development Scripts
| Script | Description |
|--------|-------------|
| npm run auto-setup | 🤖 Automatically install all required dependencies |
| npm run check-requirements | 🔍 Check development environment requirements |
| npm run clean-all-caches | 🧹 Clean all project and system caches |
| npm run install-dependencies | 📦 Install dependencies in root and example folders |
| npm run run-android | 🤖 Kill conflicting ports and run Android app |
🔧 Troubleshooting
If you encounter issues:
- Check Requirements:
npm run check-requirements - Clean & Reinstall:
npm run clean-all-caches && npm run install-dependencies - Auto Setup:
npm run auto-setup(installs missing tools) - Manual Setup: Follow the detailed error messages from check-requirements
📋 Environment Setup
The project includes intelligent scripts that will:
- ✅ Detect your operating system (macOS/Linux)
- ✅ Check for required tools and versions
- ✅ Install missing dependencies automatically
- ✅ Configure environment variables
- ✅ Apply necessary patches
- ✅ Verify the setup works correctly
Consent Mediation
You can enable and run the Consent Mediation example in this example by following the documentation.
