@mobana/react-native-sdk
v0.2.13
Published
React Native SDK for Mobana — Simple mobile app attribution, deeplinking, and dynamic remote flows
Downloads
455
Maintainers
Readme
Core Features
- Attribution & Deeplinking — Know where your installs come from and pass custom data (promo codes, referral IDs, content) through app store installs. No IDFA/GAID required.
- Conversion Tracking — Track post-install events and tie them back to campaigns for ROI measurement.
- Flows — Display dynamic remote experiences (onboarding, permission prompts, paywalls) built from the Mobana dashboard — no app store updates required.
Requirements
| Dependency | Minimum Version |
|------------|-----------------|
| React Native | >= 0.72 |
| React | >= 17.0 |
| Expo SDK | 50+ (Expo Go not supported) |
| iOS | 13.4+ |
| Android | API 23+ (Android 6.0) |
Table of Contents
Installation
The SDK supports both bare React Native and Expo. Pick the section that matches your project setup — the SDK API is identical in both environments.
Bare React Native
Attribution and conversion tracking:
npm install @mobana/react-native-sdk \
@react-native-async-storage/async-storageAdd Flows support (requires react-native-webview):
npm install @mobana/react-native-sdk \
@react-native-async-storage/async-storage \
react-native-webviewIf your flows use native permissions, you'll need to configure your iOS Podfile and Android AndroidManifest.xml. See the full installation guide for platform-specific setup.
Expo
Attribution and conversion tracking:
npx expo install @mobana/react-native-sdk \
@react-native-async-storage/async-storageAdd Flows support:
npx expo install @mobana/react-native-sdk \
@react-native-async-storage/async-storage \
react-native-webviewAdd the plugin to your app.json:
{
"expo": {
"plugins": ["@mobana/react-native-sdk"]
}
}Note: This SDK uses native code — Expo Go is not supported. Use
expo-dev-clientfor development builds.
Optional Peer Dependencies
If your Flows use permissions, haptics, reviews, or location, install the relevant optional packages:
npm install react-native-permissions \
react-native-haptic-feedback \
react-native-in-app-review \
react-native-geolocation-service \
react-native-safe-area-contextFor iOS Podfile setup, Android manifest permissions, and Expo plugin configuration, see the full installation guide.
Quick Start
1. Initialize the SDK
Call init once when your app starts. Get your App ID from the Mobana dashboard.
import { Mobana } from '@mobana/react-native-sdk';
await Mobana.init({
appId: 'YOUR_APP_ID',
debug: __DEV__,
});2. Get Attribution
const attribution = await Mobana.getAttribution();
if (attribution) {
console.log(attribution.utm_source); // e.g. "facebook"
console.log(attribution.utm_campaign); // e.g. "summer_sale"
console.log(attribution.confidence); // 0.0–1.0
if (attribution.data?.promo) {
applyPromoCode(attribution.data.promo);
}
}getAttribution() never throws — it returns null when there's no match or on error.
3. Track Conversions
Mobana.trackConversion('signup');
Mobana.trackConversion('purchase', 49.99);4. Show a Flow (optional)
Wrap your app with MobanaProvider and start flows by slug:
import { MobanaProvider, Mobana } from '@mobana/react-native-sdk';
function App() {
return (
<MobanaProvider>
<YourApp />
</MobanaProvider>
);
}
// Somewhere in your app
const result = await Mobana.startFlow('onboarding');
if (result.completed) {
console.log('User completed onboarding!', result.data);
}For the full walkthrough, see the Quick Start guide.
API
| Method | Description | Reference |
|--------|-------------|-----------|
| Mobana.init(config) | Initialize the SDK with your App ID | Docs → |
| Mobana.getAttribution() | Get install attribution and deeplink data | Docs → |
| Mobana.trackConversion(name, value?) | Track post-install conversion events | Docs → |
| Mobana.startFlow(slug, options?) | Display an in-app flow | Docs → |
| Mobana.prefetchFlow(slug) | Prefetch a flow for instant display | Docs → |
| Mobana.setTrackingEnabled(enabled) | Enable/disable attribution and tracking (GDPR consent). Flows unaffected. | Docs → |
| Mobana.reset() | Clear stored data, generate new install ID | Docs → |
| <MobanaProvider> | Context provider for Flows (wraps your app) | Docs → |
For full API reference with all options and return types, see the SDK Overview.
Flows
Flows are rich in-app experiences (onboarding, permission prompts, paywalls, announcements) you build visually in the Mobana dashboard. They run inside a WebView and communicate with your app through a JavaScript bridge.
Inside a flow, you have access to attribution data, custom parameters, native permissions, haptics, sounds, and more — all through the Mobana bridge object.
| Topic | Link | |-------|------| | What are Flows? | mobana.ai/flows | | Building Flows | Guide → | | Bridge Overview | Docs → | | Permissions | Docs → | | Events & Tracking | Guide → | | CSS Variables | Docs → |
Privacy & GDPR
Mobana is built with privacy at its core:
- No device IDs — IDFA/GAID are never required or collected
- Privacy-first matching — attribution works without invasive device fingerprinting
- Minimal data — only what's needed for attribution, nothing more
- Opt-out support — call
Mobana.setTrackingEnabled(false)to disable attribution and tracking (flows continue to work) - GDPR/CCPA compliant — see our GDPR guide and Privacy Policy
Documentation
| Resource | Link | |----------|------| | Full Documentation | mobana.ai/docs | | Installation Guide | mobana.ai/docs/installation | | Quick Start | mobana.ai/docs/quick-start | | SDK Reference | mobana.ai/docs/sdk/overview | | Flow Bridge API | mobana.ai/docs/flows/bridge-overview | | Custom Endpoints | mobana.ai/docs/guides/custom-endpoints | | GDPR & Privacy | mobana.ai/docs/guides/gdpr | | Test Setup | mobana.ai/docs/test-setup |
License
MIT — see LICENSE for details.
