@datalyr/react-native 1.6.2 → 1.6.4

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.
package/README.md CHANGED
@@ -150,7 +150,7 @@ await Datalyr.initialize({
150
150
  debug?: boolean, // Console logging (default: false)
151
151
 
152
152
  // Network
153
- endpoint?: string, // API endpoint URL (default: 'https://api.datalyr.com')
153
+ endpoint?: string, // API endpoint URL (default: 'https://ingest.datalyr.com/track')
154
154
  useServerTracking?: boolean, // Use server-side tracking (default: true)
155
155
  maxRetries?: number, // Max retry attempts for failed requests (default: 3)
156
156
  retryDelay?: number, // Delay between retries in ms (default: 1000)
@@ -732,7 +732,10 @@ export class DatalyrSDK {
732
732
  set('ttclid', attribution.ttclid);
733
733
  set('idfa', advertiser === null || advertiser === void 0 ? void 0 : advertiser.idfa);
734
734
  set('gaid', advertiser === null || advertiser === void 0 ? void 0 : advertiser.gaid);
735
- set('att_status', advertiser === null || advertiser === void 0 ? void 0 : advertiser.att_status);
735
+ if ((advertiser === null || advertiser === void 0 ? void 0 : advertiser.att_status) != null) {
736
+ const statusMap = { 0: 'notDetermined', 1: 'restricted', 2: 'denied', 3: 'authorized' };
737
+ set('att_status', statusMap[advertiser.att_status] || String(advertiser.att_status));
738
+ }
736
739
  return attrs;
737
740
  }
738
741
  /**
@@ -142,6 +142,7 @@ export class HttpClient {
142
142
  transformForServerAPI(payload) {
143
143
  return {
144
144
  event: payload.eventName,
145
+ eventId: payload.eventId,
145
146
  userId: payload.userId || payload.visitorId,
146
147
  anonymousId: payload.anonymousId || payload.visitorId,
147
148
  properties: {
@@ -152,8 +153,8 @@ export class HttpClient {
152
153
  },
153
154
  context: {
154
155
  library: '@datalyr/react-native',
155
- version: '1.5.0',
156
- source: 'mobile_app', // Explicitly set source for mobile
156
+ version: '1.6.2',
157
+ source: 'mobile_app',
157
158
  userProperties: payload.userProperties,
158
159
  },
159
160
  timestamp: payload.timestamp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalyr/react-native",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "description": "Datalyr SDK for React Native & Expo - Server-side attribution tracking for iOS and Android",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -894,7 +894,10 @@ export class DatalyrSDK {
894
894
  set('ttclid', attribution.ttclid);
895
895
  set('idfa', advertiser?.idfa);
896
896
  set('gaid', advertiser?.gaid);
897
- set('att_status', advertiser?.att_status);
897
+ if (advertiser?.att_status != null) {
898
+ const statusMap: Record<number, string> = { 0: 'notDetermined', 1: 'restricted', 2: 'denied', 3: 'authorized' };
899
+ set('att_status', statusMap[advertiser.att_status] || String(advertiser.att_status));
900
+ }
898
901
 
899
902
  return attrs;
900
903
  }
@@ -187,6 +187,7 @@ export class HttpClient {
187
187
  private transformForServerAPI(payload: EventPayload): any {
188
188
  return {
189
189
  event: payload.eventName,
190
+ eventId: payload.eventId,
190
191
  userId: payload.userId || payload.visitorId,
191
192
  anonymousId: payload.anonymousId || payload.visitorId,
192
193
  properties: {
@@ -197,8 +198,8 @@ export class HttpClient {
197
198
  },
198
199
  context: {
199
200
  library: '@datalyr/react-native',
200
- version: '1.5.0',
201
- source: 'mobile_app', // Explicitly set source for mobile
201
+ version: '1.6.2',
202
+ source: 'mobile_app',
202
203
  userProperties: payload.userProperties,
203
204
  },
204
205
  timestamp: payload.timestamp,