@traqio/react-native
v0.1.2
Published
Traqio SDK for React Native / Expo — deterministic install attribution (Play Install Referrer) + SKAN. No IDFA, no fingerprinting.
Maintainers
Readme
@traqio/react-native
The Traqio SDK for React Native: mobile install attribution and ROAS for Meta and TikTok campaigns. On Android it reads the Google Play Install Referrer — deterministic attribution, no advertising id by default (opt-in, below). On iOS it registers installs with SKAdNetwork, sets conversion values from the mapping you publish, and reports the Apple Ads attribution token. It queues your events offline and resolves deep links.
One package: an autolinked native module (Kotlin + Swift) and the JavaScript engine
@traqio/core. For an Expo app, use the
alias @traqio/expo — the same module —
and never both.
Install
The native half is an Expo module, so a bare React Native project needs Expo Modules once:
npx install-expo-modules@latest
npm install @traqio/react-native @react-native-async-storage/async-storage
cd ios && pod installAsyncStorage is how the SDK reports the install exactly once and keeps queued events across restarts.
Initialize
// index.js — before AppRegistry.registerComponent
import { Traqio, getNativeBridge } from "@traqio/react-native";
Traqio.init({
sdkKey: "YOUR_SDK_KEY", // from the Traqio console — public by design
endpoint: "https://api.traqio.app", // origin only
native: getNativeBridge(), // Install Referrer (Android), SKAdNetwork + Apple Ads (iOS)
});On iOS, declare Traqio as the SKAdNetwork postback endpoint in Info.plist:
<key>NSAdvertisingAttributionReportEndpoint</key>
<string>https://api.traqio.app</string>Track events
Traqio.setUserId(user.id); // the same id you give RevenueCat (app_user_id)
Traqio.track("purchase", { value: 9.99, currency: "EUR", transactionId: purchase.transactionId });
Traqio.onDeepLink(({ deepLink }) => {
if (deepLink) navigateTo(deepLink); // direct opens and the deferred link of a fresh install
});Advertising id (opt-in)
Off by default (collectAdvertisingId: false): the SDK reads no IDFA / GAID and never
shows the App Tracking Transparency prompt. Turn it on when you buy on a network that
attributes by that id (Unity Ads, AppLovin):
Traqio.init({ sdkKey: "SDK_KEY", endpoint: "https://api.traqio.app", collectAdvertisingId: true });- iOS: ask ATT in your app before
initand link AdSupport; the IDFA is read only if the user said yes. - Android: add
com.google.android.gms:play-services-ads-identifierand thecom.google.android.gms.permission.AD_IDpermission; nothing is sent when the user limited ad tracking.
It is sent with the install only, matched hashed, and never used as the user's identity.
Requirements
- React Native 0.74+, with Expo Modules installed.
- iOS 15.1+. Android: no permission needed.
- Not Expo Go — a development build or a release build.
Documentation
Setup, deep links, platform notes: https://traqio.app/docs/sdks/react-native · full API: https://traqio.app/docs/sdks/javascript
License
MIT
