react-native-routix
v1.0.6
Published
The official Routix SDK for React Native. Attribute deep links and track conversion events.
Maintainers
Readme
Routix React Native SDK 🚀
The official Routix SDK for React Native. Professional attribution, deep linking, and conversion tracking for your cross-platform mobile apps.
📖 Table of Contents
🚀 Features
- 🎯 Precision Attribution: Resolve deep links via Android Install Referrer and iOS Fingerprinting.
- 📈 Conversion Tracking: Track
install,lead, andsaleevents with robust metadata support. - ⚛️ Native Performance: Built with TypeScript and optimized for React Native 0.60+.
- 🛡️ Privacy First: Lightweight implementation focusing on essential attribution data.
📦 Installation
npm install react-native-routix
# or
yarn add react-native-routixAndroid Setup
Add the Install Referrer dependency to your android/app/build.gradle:
dependencies {
implementation 'com.android.installreferrer:installreferrer:2.2'
}iOS Setup
Run pod install in your ios directory:
cd ios && pod install🛠️ Usage
1. Initialize the SDK
Initialize the SDK at the root of your application (e.g., App.js or index.js).
import { Routix } from 'react-native-routix';
Routix.initialize({
apiKey: 'your_workspace_api_key'
});2. Resolve Deep Links (Deferred)
Resolve attribution data on app launch for users arriving via the App Store/Play Store.
const resolveAttribution = async () => {
try {
const match = await Routix.resolve({ enableClipboard: true });
if (match?.success) {
console.log('Attributed to:', match.short_code);
}
} catch (error) {
console.error('Routix Resolve Error:', error);
}
};3. Handle Deep Links (Direct)
Parses a direct deep link URL when the app is already installed.
import { Linking } from 'react-native';
Linking.getInitialURL().then((url) => {
if (url) {
const match = Routix.handleDeepLink(url);
if (match?.success) {
console.log('Opened via:', match.short_code);
}
}
});4. Track Events
Tie conversion events directly to a campaign short code for ROI analysis.
await Routix.trackSale('SUMMER_24', 29.99, 'USD', { plan: 'pro' });5. Track Custom Events
Track workspace-level actions like signups or tutorial completions independent of any link.
await Routix.trackCustomEvent('sign_up_completed', {
method: 'email'
});🤝 Support
- Documentation: routix.link/docs
- Issues: Report bugs via GitHub Issues
📄 License
This SDK is distributed under the MIT License. See LICENSE for more information.
