echostack-react-native
v2.2.0
Published
EchoStack mobile attribution SDK for React Native and Expo
Downloads
469
Maintainers
Readme
EchoStack React Native / Expo SDK
Pure TypeScript mobile attribution SDK. No native modules required. Works in:
- Expo Go
- Expo builds (EAS)
- Bare React Native
Installation
npm install echostack-react-native @react-native-async-storage/async-storageOptional (better device info):
npx expo install expo-device expo-constantsQuick Start
import { EchoStack, EventType } from 'echostack-react-native';
// 1. Configure (sends install ping automatically)
await EchoStack.configure('es_live_...');
// 2. Track events
await EchoStack.sendEvent(EventType.Purchase, {
revenue: 29.99,
currency: 'USD',
});
// 3. Get attribution
const attribution = await EchoStack.getAttributionParams();API
EchoStack.configure(apiKey, options?): Promise<void> // Init + install ping
EchoStack.sendEvent(eventType, params?): Promise<void> // Queue + batch send
EchoStack.getEchoStackId(): Promise<string | null>
EchoStack.getAttributionParams(): Promise<Attribution | null>
EchoStack.isSdkDisabled(): boolean
EchoStack.flush(): Promise<void> // Force flush queueHow It Works
- Device ID persisted in AsyncStorage (survives app restarts)
- Install ping sent on first
configure()call - Events queued locally, flushed every 30s or on purchase/subscribe
- Auto-flush on app background
- 401 from server disables SDK (invalid API key)
License
MIT
