React Native SDK

Nohmo ships a first-party React Native SDK under nohmo/react-native. One npm package, two platforms — iOS and Android.

Install

bash
npm install nohmo
# Recommended persists device ID across app restarts
npm install @react-native-async-storage/async-storage
# For uninstall detection only
npm install @react-native-firebase/app @react-native-firebase/messaging
PackageWhat it enablesRequired?
nohmoCore SDK — events, sessions, user identity, screen trackingYes
@react-native-async-storage/async-storagePersistent device ID across app restarts (returning-device recognition)Recommended
@react-native-firebase/messagingSilent daily ping for uninstall detection — requires FCM setup in Settings → AppOptional

Setup

Add this once in App.tsx. Your Project ID and API key are in Dashboard → Settings → General → SDK credentials.

tsx
// App.tsx
import { NohmoProvider } from 'nohmo/react-native'
import AsyncStorage from '@react-native-async-storage/async-storage'
export default function App() {
return (
<NohmoProvider
projectId="proj_xxxx" // from Settings → General → SDK credentials
apiKey="pk_xxxx"
options={{
appVersion: '1.0.0',
debug: __DEV__,
storage: AsyncStorage,
}}
>
<YourApp />
</NohmoProvider>
)
}
// babel.config.js — add this to auto-track every button tap and screen view
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: ['nohmo/babel-plugin'],
}

Note: Install attribution (Android Play Store referrer + iOS pasteboard) is built into the SDK — no extra packages needed. The Firebase package is only required for uninstall detection. No extra code needed anywhere in your app beyond the NohmoProvider setup above.

Autocapture — press events & screen views

Add one line to babel.config.js and the SDK tracks every button tap and every screen view automatically — no code changes per component.

js
// babel.config.js
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: ['nohmo/babel-plugin'], // ← add this
}
EventWhat triggers it
PRESSAny onPress tap on any component
LONG_PRESSAny onLongPress on any component
SCREEN_VIEWEvery navigation state change via NavigationContainer

The plugin works at compile time — it wraps onPress / onLongPress props and injects onStateChange + onReady on <NavigationContainer>. You never touch those components.

Note: Each PRESS event includes component (e.g. Pressable), text (static label if present), file, and line.

What gets tracked automatically

EventTriggerData
APP_INSTALLFirst ever app openplatform, appVersion, osVersion
APP_OPENEvery time app becomes activeplatform, appVersion
APP_BACKGROUNDApp goes to backgroundsessionDurationSecs, screen
INSTALL_ATTRIBUTEDAttribution read on first open — Play Store referrer (Android) or pasteboard token (iOS)utm_source, utm_medium, utm_campaign, nohmo_click
PRESSonPress tap — requires babel plugincomponent, text, file, line
LONG_PRESSonLongPress — requires babel plugincomponent, text, file, line
SCREEN_VIEWNavigationContainer change — requires babel pluginscreen

Manual screen tracking (without the plugin)

If you prefer per-screen control or aren't using the Babel plugin, call useScreenView() in each screen component:

tsx
import { useScreenView } from 'nohmo/react-native'
export default function HomeScreen() {
useScreenView('Home') // fires SCREEN_VIEW on mount, TIME_SPENT on unmount
return <View></View>
}

Custom events

tsx
const { send } = useNohmo()
send('button_tapped', { buttonId: 'cta_signup' })
send('checkout_started', { cartValue: 49.99 })

Identify users

tsx
const { linkUser } = useNohmo()
await linkUser(user.id, user.email, { plan: user.plan })

Track conversions

tsx
const { trackConversion } = useNohmo()
trackConversion('user_created')
trackConversion('purchase', { amount: 29.99, currency: 'USD' })

Define conversion goals in Settings → Conversions first. Results appear in Traffic → Conversions.

Deep link attribution

Pass UTM params in your deep link and the SDK captures them automatically on first open:

bash
yourapp://open?utm_source=meta&utm_medium=cpc&utm_campaign=summer

Attribution is attached to every event in that session and appears in Traffic → Attribution.