SDKs
React Native SDK
Add Traqio to a bare React Native app: enable Expo Modules, install @traqio/react-native, initialise before registering the app, and wire iOS and Android.
@traqio/react-native is the Traqio SDK for React Native. It ships an autolinked native module (Kotlin and Swift) and re-exports the JavaScript engine, @traqio/core, so your app imports everything from one package. It is the SDK verified end to end on a device: a click, an install from Google Play, the referrer read on first launch, an install attributed deterministically. For an Expo app, follow the Expo page instead.
Available on npm
@traqio/react-native · version 0.1.0How far it is proven: Verified end-to-end on a device: click → install referrer → attributed install.Requirements#
- React Native 0.74 or later.
- Expo Modules in the project (
npx install-expo-modules@latest) — the native half is an Expo module. - iOS 15.1 or later. Android needs no permission (unless you opt in to the advertising id).
Set up#
Enable Expo Modules#
npx install-expo-modules@latestOnce per project. Skip it if your app already uses any Expo module.
Install the package#
npm install @traqio/react-native @react-native-async-storage/async-storage cd ios && pod installAsyncStorage is what makes the install fire exactly once and keeps queued events across restarts; the SDK picks it up on its own when it is installed. Without it, the SDK warns and reports the install again at every launch.
Initialise before registering the app#
// index.js — before AppRegistry.registerComponent import { Traqio, getNativeBridge } from "@traqio/react-native"; import { version } from "./package.json"; Traqio.init({ sdkKey: "YOUR_SDK_KEY", endpoint: "https://api.traqio.app", native: getNativeBridge(), appVersion: version, });Initialising before
AppRegistry.registerComponentmeans the SDK is listening when the URL that opened the app is delivered. The call is idempotent.Declare the SKAdNetwork endpoint#
<key>NSAdvertisingAttributionReportEndpoint</key> <string>https://api.traqio.app</string>iOS then sends Traqio a copy of every SKAdNetwork postback for your app. Origin only: iOS appends its own path.
Track events and set the user id#
Traqio.setUserId(user.id); // after sign-in — same id as RevenueCat's app_user_id Traqio.track("purchase", { value: 9.99, currency: "EUR", transactionId: purchase.transactionId });See Events and revenue for the names that Meta and TikTok can optimise on, and why
transactionIdmatters.
Deep links#
The SDK listens to React Native's Linking itself — the initial URL and every later one — and hands Traqio links to your callback:
Traqio.onDeepLink(({ deepLink }) => {
if (deepLink) navigation.navigate(...routeFor(deepLink)); // your router's call
});Links open the app only if the app declares your branded domain:
<!-- android/app/src/main/AndroidManifest.xml, inside the main <activity> -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="go.example.com" android:pathPrefix="/c/" />
</intent-filter>On iOS, add applinks:go.example.com under Signing & Capabilities → Associated Domains, and let React Native receive universal links as usual:
// AppDelegate — hand universal links to React Native's Linking, as usual
- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> *))restorationHandler {
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}The domain itself is set up in the console; see Deep linking.
Platform notes#
Android#
- The module declares the
<queries>entry that lets it see Google Play on Android 11+; no manifest change is needed for attribution. - If Google Play does not answer at first launch, the install is held and retried on the next launches (up to three) rather than reported organic.
iOS#
- No App Tracking Transparency prompt is needed or shown by the SDK.
- Conversion values follow the mapping you publish in the console. If your app already manages its own conversion-value schema, turn the SDK's off with
skan: false— two writers would fight over the same six bits.
Advertising id (opt-in)#
Off by default: the SDK sends no IDFA or GAID. Turn on collectAdvertisingId only if you buy from networks that attribute by the advertising id — Unity Ads and AppLovin match their click to your install on it. It is sent with the install and never used as its identity.
Traqio.init({
sdkKey: "YOUR_SDK_KEY",
endpoint: "https://api.traqio.app",
native: getNativeBridge(),
collectAdvertisingId: true, // off by default
});- iOS: the SDK never shows the App Tracking Transparency prompt — ask for it yourself before
init, and link AdSupport. The IDFA is read only if the user already allowed tracking. - Android: add
com.google.android.gms:play-services-ads-identifierand thecom.google.android.gms.permission.AD_IDpermission to your app; the SDK declares neither. - Declare the advertising id in your App Store privacy details and Google Play Data safety form.
Full API
Frequently asked questions#
- Why does a bare React Native app need Expo Modules?
- The SDK's native half (the Install Referrer reader on Android, the SKAdNetwork driver on iOS) is written as an Expo module, so it needs the small Expo Modules runtime that install-expo-modules adds to a bare project. It does not turn the app into an Expo managed app and adds no Expo service.
- Do I need to flush events or report app opens myself?
- No. On React Native the SDK listens to AppState: it sends the queue when the app goes to the background and records an app open when it comes back after 30 minutes or more. Hosts without React Native's AppState, such as Capacitor, call flush() and appOpened() themselves.