React Native and Expo
Install @talivia/react-native and track native screens, events, and known users.
Use @talivia/react-native for native iOS and Android apps built with React Native or Expo. For Expo Web, use the Expo Web installation guide instead.
Install
npm install @talivia/react-nativeFor Expo, also install the storage and UUID adapters:
npx expo install @react-native-async-storage/async-storage expo-cryptoInitialize and track
import AsyncStorage from '@react-native-async-storage/async-storage';
import * as Crypto from 'expo-crypto';
import { Platform } from 'react-native';
import { Talivia } from '@talivia/react-native';
const analytics = new Talivia({
websiteId: 'YOUR_WEBSITE_UUID',
host: 'https://talivia.com',
hostname: 'example.com', // use your website domain for a shared workspace
platform: Platform.OS === 'ios' ? 'ios' : 'android',
storage: AsyncStorage,
uuid: prefix => `${prefix}_${Crypto.randomUUID()}`,
});
await analytics.init();
await analytics.screen('Home');
await analytics.track('signup_completed', { plan: 'pro' });
await analytics.identify('your-stable-user-id');
// On logout: await analytics.reset();Call screen() from your React Navigation or Expo Router change callback. Call track() only after the action succeeds. For bare React Native, provide a storage adapter and secure UUID generator appropriate to your app; runtimes with crypto.randomUUID or crypto.getRandomValues do not need an explicit UUID adapter.
Initialize only when consent permits collection. Call flush() when connectivity returns if you want to retry queued events before the next app event. The retry queue is memory-only and capped at 100 events.
Using the same Website ID and hostname as web makes both sources visible in one Talivia workspace. identify() links known account identity records when the stable ID matches; current funnels still group by visitor token across devices. Install attribution and purchases are not captured automatically. Send verified revenue from your backend.