@datalyr/react-native 1.5.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +82 -121
  3. package/android/build.gradle +0 -7
  4. package/android/src/main/java/com/datalyr/reactnative/DatalyrNativeModule.java +2 -380
  5. package/android/src/main/java/com/datalyr/reactnative/DatalyrPackage.java +1 -1
  6. package/datalyr-react-native.podspec +3 -7
  7. package/expo-module.config.json +4 -1
  8. package/ios/DatalyrNativeModule.swift +0 -266
  9. package/lib/datalyr-sdk.d.ts +14 -5
  10. package/lib/datalyr-sdk.js +90 -144
  11. package/lib/http-client.js +2 -2
  12. package/lib/index.d.ts +1 -1
  13. package/lib/index.js +1 -1
  14. package/lib/integrations/index.d.ts +3 -4
  15. package/lib/integrations/index.js +3 -4
  16. package/lib/native/DatalyrNativeBridge.d.ts +6 -22
  17. package/lib/native/DatalyrNativeBridge.js +6 -147
  18. package/lib/native/index.d.ts +1 -1
  19. package/lib/native/index.js +1 -1
  20. package/lib/types.d.ts +5 -19
  21. package/package.json +3 -5
  22. package/src/datalyr-sdk-expo.ts +96 -140
  23. package/src/datalyr-sdk.ts +102 -174
  24. package/src/http-client.ts +2 -2
  25. package/src/index.ts +1 -1
  26. package/src/integrations/index.ts +3 -4
  27. package/src/native/DatalyrNativeBridge.ts +6 -241
  28. package/src/native/index.ts +0 -2
  29. package/src/types.ts +11 -26
  30. package/src/utils-expo.ts +2 -2
  31. package/ios/DatalyrObjCExceptionCatcher.h +0 -14
  32. package/ios/DatalyrObjCExceptionCatcher.m +0 -30
  33. package/lib/integrations/meta-integration.d.ts +0 -77
  34. package/lib/integrations/meta-integration.js +0 -219
  35. package/lib/integrations/tiktok-integration.d.ts +0 -83
  36. package/lib/integrations/tiktok-integration.js +0 -360
  37. package/src/integrations/meta-integration.ts +0 -239
  38. package/src/integrations/tiktok-integration.ts +0 -363
package/CHANGELOG.md CHANGED
@@ -5,6 +5,45 @@ All notable changes to the Datalyr React Native SDK will be documented in this f
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.6.0] - 2026-03
9
+
10
+ ### Removed
11
+ - **Meta (Facebook) SDK** - Removed FBSDKCoreKit (iOS) and facebook-android-sdk (Android) dependencies
12
+ - **TikTok Business SDK** - Removed TikTokBusinessSDK (iOS) and tiktok-business-android-sdk (Android) dependencies
13
+ - Removed ByteDance maven repository from Android build
14
+ - Removed `MetaConfig`, `TikTokConfig` TypeScript interfaces
15
+ - Removed `MetaNativeBridge`, `TikTokNativeBridge` native bridge modules
16
+ - Removed all client-side event forwarding to Meta/TikTok
17
+ - Removed `meta-integration.ts`, `tiktok-integration.ts`, `DatalyrObjCExceptionCatcher`
18
+
19
+ ### Changed
20
+ - Conversion event routing to Meta (CAPI), TikTok (Events API), and Google Ads is now handled entirely server-side via the Datalyr postback system
21
+ - IDFA/ATT and GAID now use native Apple/Google frameworks directly
22
+ - `getPlatformIntegrationStatus()` returns only `appleSearchAds` and `playInstallReferrer`
23
+
24
+ ### Migration from v1.5.x
25
+ Remove `meta` and `tiktok` config objects from your `initialize()` call:
26
+ ```typescript
27
+ // Before (v1.5.x)
28
+ await Datalyr.initialize({
29
+ apiKey: 'dk_...',
30
+ meta: { appId: 'FB_APP_ID', clientToken: '...' }, // REMOVE
31
+ tiktok: { appId: '...', tiktokAppId: '...' }, // REMOVE
32
+ });
33
+
34
+ // After (v1.6.0)
35
+ await Datalyr.initialize({
36
+ apiKey: 'dk_...',
37
+ });
38
+ ```
39
+ No other code changes needed. All tracking methods (`trackPurchase`, `trackAddToCart`, etc.) work the same — events are routed to ad platforms server-side via your Datalyr postback rules.
40
+
41
+ If you were importing `metaIntegration` or `tiktokIntegration` directly, remove those imports — they no longer exist.
42
+
43
+ iOS: Remove from Info.plist: `FacebookAppID`, `FacebookClientToken`, `FacebookDisplayName`, and `LSApplicationQueriesSchemes` entries for TikTok.
44
+
45
+ Android: No changes needed — Meta/TikTok dependencies are automatically removed on `pod install` / gradle sync.
46
+
8
47
  ## [1.3.1] - 2026-01
9
48
 
10
49
  ### Added
package/README.md CHANGED
@@ -18,15 +18,19 @@ Mobile analytics and attribution SDK for React Native and Expo. Track events, id
18
18
  - [User Properties](#user-properties)
19
19
  - [Attribution](#attribution)
20
20
  - [Automatic Capture](#automatic-capture)
21
- - [Deferred Deep Links](#deferred-deep-links)
22
21
  - [Web-to-App Attribution](#web-to-app-attribution)
23
22
  - [Event Queue](#event-queue)
24
23
  - [Auto Events](#auto-events)
25
24
  - [SKAdNetwork](#skadnetwork)
26
25
  - [Platform Integrations](#platform-integrations)
27
- - [Meta](#meta-facebook)
26
+ - [Meta (Facebook)](#meta-facebook)
28
27
  - [TikTok](#tiktok)
28
+ - [Google Ads](#google-ads)
29
29
  - [Apple Search Ads](#apple-search-ads)
30
+ - [Third-Party Integrations](#third-party-integrations)
31
+ - [Superwall](#superwall)
32
+ - [RevenueCat](#revenuecat)
33
+ - [Migrating from AppsFlyer / Adjust](#migrating-from-appsflyer--adjust)
30
34
  - [Expo Support](#expo-support)
31
35
  - [TypeScript](#typescript)
32
36
  - [Troubleshooting](#troubleshooting)
@@ -46,38 +50,6 @@ npm install @datalyr/react-native
46
50
  cd ios && pod install
47
51
  ```
48
52
 
49
- This installs the SDK with bundled Meta and TikTok native SDKs.
50
-
51
- Add to `ios/YourApp/Info.plist`:
52
-
53
- ```xml
54
- <!-- Meta SDK -->
55
- <key>FacebookAppID</key>
56
- <string>YOUR_FACEBOOK_APP_ID</string>
57
- <key>FacebookClientToken</key>
58
- <string>YOUR_CLIENT_TOKEN</string>
59
- <key>FacebookDisplayName</key>
60
- <string>Your App Name</string>
61
-
62
- <key>CFBundleURLTypes</key>
63
- <array>
64
- <dict>
65
- <key>CFBundleURLSchemes</key>
66
- <array>
67
- <string>fbYOUR_FACEBOOK_APP_ID</string>
68
- </array>
69
- </dict>
70
- </array>
71
-
72
- <!-- TikTok SDK -->
73
- <key>LSApplicationQueriesSchemes</key>
74
- <array>
75
- <string>tiktok</string>
76
- <string>snssdk1180</string>
77
- <string>snssdk1233</string>
78
- </array>
79
- ```
80
-
81
53
  ### Android Setup
82
54
 
83
55
  No additional setup required.
@@ -171,9 +143,6 @@ await Datalyr.initialize({
171
143
  // iOS
172
144
  skadTemplate?: 'ecommerce' | 'gaming' | 'subscription',
173
145
 
174
- // Platform SDKs
175
- meta?: MetaConfig,
176
- tiktok?: TikTokConfig,
177
146
  });
178
147
  ```
179
148
 
@@ -221,7 +190,7 @@ await Datalyr.screen('Product Details', {
221
190
 
222
191
  ### E-Commerce Events
223
192
 
224
- Standard e-commerce events that also forward to Meta and TikTok:
193
+ Standard e-commerce events:
225
194
 
226
195
  ```typescript
227
196
  // View product
@@ -283,7 +252,6 @@ await Datalyr.identify('user_123', {
283
252
  After `identify()`:
284
253
  - All future events include `user_id`
285
254
  - Historical anonymous events can be linked server-side
286
- - User data is forwarded to Meta/TikTok for Advanced Matching
287
255
 
288
256
  ### User Properties
289
257
 
@@ -336,27 +304,6 @@ Captured parameters:
336
304
  | Click IDs | `fbclid`, `gclid`, `ttclid`, `twclid`, `li_click_id`, `msclkid` |
337
305
  | Campaign | `campaign_id`, `adset_id`, `ad_id` |
338
306
 
339
- ### Deferred Deep Links
340
-
341
- Capture attribution from App Store installs (iOS):
342
-
343
- ```typescript
344
- await Datalyr.initialize({
345
- apiKey: 'dk_your_api_key',
346
- meta: {
347
- appId: '1234567890',
348
- enableDeferredDeepLink: true,
349
- },
350
- });
351
-
352
- // Check for deferred attribution
353
- const deferred = Datalyr.getDeferredAttributionData();
354
- if (deferred) {
355
- console.log(deferred.fbclid); // Facebook click ID
356
- console.log(deferred.campaignId); // Campaign ID
357
- }
358
- ```
359
-
360
307
  ### Web-to-App Attribution
361
308
 
362
309
  Automatically recover attribution from a web prelander when users install the app from an ad.
@@ -474,46 +421,52 @@ await Datalyr.trackPurchase(99.99, 'USD');
474
421
 
475
422
  ## Platform Integrations
476
423
 
477
- Bundled Meta and TikTok SDKs for iOS. No extra npm packages needed.
424
+ Conversion events are routed to ad platforms server-side via the Datalyr postback system. No client-side ad SDKs (Facebook SDK, TikTok SDK, etc.) are needed in your app. The SDK captures click IDs and attribution data from ad URLs, then the backend handles hashing, formatting, and sending conversions to each platform's API.
478
425
 
479
426
  ### Meta (Facebook)
480
427
 
481
- ```typescript
482
- await Datalyr.initialize({
483
- apiKey: 'dk_your_api_key',
484
- meta: {
485
- appId: '1234567890',
486
- clientToken: 'abc123',
487
- enableDeferredDeepLink: true,
488
- enableAppEvents: true,
489
- },
490
- });
491
- ```
428
+ Conversions are sent to Meta via the [Conversions API (CAPI)](https://developers.facebook.com/docs/marketing-api/conversions-api/).
429
+
430
+ **What the SDK does:** Captures `fbclid` from ad click URLs, collects IDFA (when ATT authorized on iOS), and sends user data (email, phone) with events.
431
+
432
+ **What the backend does:** Hashes PII (SHA-256), formats the CAPI payload, and sends conversions with the `fbclid` and `_fbc`/`_fbp` cookies for matching.
433
+
434
+ **Setup:**
435
+ 1. Connect your Meta ad account in the Datalyr dashboard (Settings > Connections)
436
+ 2. Select your Meta Pixel
437
+ 3. Create postback rules to map events (e.g., `purchase` → `Purchase`, `lead` → `Lead`)
438
+
439
+ No Facebook SDK needed in your app. No `Info.plist` changes, no `FacebookAppID`.
492
440
 
493
441
  ### TikTok
494
442
 
495
- ```typescript
496
- await Datalyr.initialize({
497
- apiKey: 'dk_your_api_key',
498
- tiktok: {
499
- appId: 'your_app_id', // Events API App ID
500
- tiktokAppId: '7123456789', // TikTok App ID (Developer Portal)
501
- accessToken: 'your_access_token', // Events API Access Token
502
- enableAppEvents: true,
503
- },
504
- });
505
- ```
443
+ Conversions are sent to TikTok via the [Events API](https://business-api.tiktok.com/portal/docs?id=1741601162187777).
506
444
 
507
- **Where to find your TikTok credentials:**
445
+ **What the SDK does:** Captures `ttclid` from ad click URLs and collects device identifiers (IDFA on iOS, GAID on Android).
508
446
 
509
- | Credential | Where to get it |
510
- |------------|----------------|
511
- | `tiktokAppId` | [TikTok Developer Portal](https://developers.tiktok.com) → Your App → App ID |
512
- | `appId` | TikTok Business Center → Assets → Events → Your App → App ID |
513
- | `accessToken` | TikTok Business Center → Assets → Events → Your App → Settings → Access Token |
447
+ **What the backend does:** Hashes user data, formats the Events API payload, and sends conversions with the `ttclid` and `_ttp` cookie for matching.
514
448
 
515
- > **Note:** The `accessToken` enables client-side TikTok SDK features (enhanced attribution, real-time event forwarding). Without it, events are still tracked server-side via Datalyr postbacks — you'll see a warning in debug mode.
516
- ```
449
+ **Setup:**
450
+ 1. Connect your TikTok Ads account in the Datalyr dashboard (Settings > Connections)
451
+ 2. Select your TikTok Pixel
452
+ 3. Create postback rules to map events (e.g., `purchase` → `CompletePayment`, `add_to_cart` → `AddToCart`)
453
+
454
+ No TikTok SDK needed in your app. No access tokens, no native configuration.
455
+
456
+ ### Google Ads
457
+
458
+ Conversions are sent to Google via the [Google Ads API](https://developers.google.com/google-ads/api/docs/conversions/overview).
459
+
460
+ **What the SDK does:** Captures `gclid`, `gbraid`, and `wbraid` from ad click URLs. Collects user data for enhanced conversions.
461
+
462
+ **What the backend does:** Hashes user data, maps events to Google conversion actions, and sends conversions with click IDs for attribution.
463
+
464
+ **Setup:**
465
+ 1. Connect your Google Ads account in the Datalyr dashboard (Settings > Connections)
466
+ 2. Select your conversion actions
467
+ 3. Create postback rules to map events (e.g., `purchase` → your Google conversion action)
468
+
469
+ No Google SDK needed in your app beyond the Play Install Referrer (already included for Android).
517
470
 
518
471
  ### Apple Search Ads
519
472
 
@@ -554,7 +507,7 @@ await Datalyr.updateTrackingAuthorization(status === 'granted');
554
507
 
555
508
  ```typescript
556
509
  const status = Datalyr.getPlatformIntegrationStatus();
557
- // { meta: true, tiktok: true, appleSearchAds: true }
510
+ // { appleSearchAds: true }
558
511
  ```
559
512
 
560
513
  ---
@@ -634,6 +587,43 @@ await Datalyr.trackPurchase(99.99, 'USD');
634
587
 
635
588
  ---
636
589
 
590
+ ## Third-Party Integrations
591
+
592
+ ### Superwall
593
+
594
+ Pass Datalyr attribution data to Superwall to personalize paywalls by ad source, campaign, ad set, and keyword.
595
+
596
+ ```typescript
597
+ import Datalyr from '@datalyr/react-native';
598
+ import Superwall from '@superwall/react-native-superwall';
599
+
600
+ // After both SDKs are initialized
601
+ Superwall.setUserAttributes(Datalyr.getSuperwallAttributes());
602
+
603
+ // Your placements will now have attribution data available as filters
604
+ Superwall.register({ placement: 'onboarding_paywall' });
605
+ ```
606
+
607
+ Call after `Datalyr.initialize()` completes. If using ATT on iOS, call again after the user responds to the ATT prompt to include the IDFA.
608
+
609
+ ### RevenueCat
610
+
611
+ Pass Datalyr attribution data to RevenueCat for revenue attribution and offering targeting.
612
+
613
+ ```typescript
614
+ import Datalyr from '@datalyr/react-native';
615
+ import Purchases from 'react-native-purchases';
616
+
617
+ // After both SDKs are configured
618
+ Purchases.setAttributes(Datalyr.getRevenueCatAttributes());
619
+ ```
620
+
621
+ Call after configuring the Purchases SDK and before the first purchase. If using ATT, call again after permission is granted to include IDFA.
622
+
623
+ > Datalyr also receives Superwall and RevenueCat events via server-side webhooks for analytics. The SDK methods and webhook integration are independent — you can use one or both.
624
+
625
+ ---
626
+
637
627
  ## Troubleshooting
638
628
 
639
629
  ### Events Not Appearing
@@ -683,35 +673,6 @@ cd android && ./gradlew clean
683
673
  npx react-native run-android
684
674
  ```
685
675
 
686
- ### Meta SDK Not Working
687
-
688
- Verify Info.plist:
689
- ```xml
690
- <key>FacebookAppID</key>
691
- <string>YOUR_APP_ID</string>
692
- <key>FacebookClientToken</key>
693
- <string>YOUR_CLIENT_TOKEN</string>
694
- ```
695
-
696
- Check status: `Datalyr.getPlatformIntegrationStatus()`
697
-
698
- ### TikTok SDK Not Working
699
-
700
- 1. Make sure you have all three TikTok credentials (see [TikTok setup](#tiktok))
701
- 2. The `accessToken` is required for client-side SDK — without it, you'll see a warning but server-side tracking still works
702
- 3. Check status: `Datalyr.getPlatformIntegrationStatus()`
703
-
704
- ```typescript
705
- await Datalyr.initialize({
706
- apiKey: 'dk_your_api_key',
707
- tiktok: {
708
- appId: 'your_app_id',
709
- tiktokAppId: '7123456789012345',
710
- accessToken: 'your_access_token',
711
- },
712
- });
713
- ```
714
-
715
676
  ### SKAdNetwork Not Updating
716
677
 
717
678
  1. iOS 14.0+ required (16.1+ for SKAN 4.0)
@@ -36,19 +36,12 @@ android {
36
36
  repositories {
37
37
  google()
38
38
  mavenCentral()
39
- maven { url "https://artifact.bytedance.com/repository/pangle" } // TikTok SDK
40
39
  }
41
40
 
42
41
  dependencies {
43
42
  // React Native
44
43
  implementation "com.facebook.react:react-native:+"
45
44
 
46
- // Meta (Facebook) SDK - Updated Jan 2026
47
- implementation 'com.facebook.android:facebook-android-sdk:18.1.3'
48
-
49
- // TikTok Business SDK - Updated Jan 2026
50
- implementation 'com.tiktok.business.sdk:tiktok-business-android-sdk:1.6.0'
51
-
52
45
  // Google Play Install Referrer
53
46
  implementation 'com.android.installreferrer:installreferrer:2.2'
54
47