@datalyr/react-native 1.1.1 → 1.2.0
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/CHANGELOG.md +24 -141
- package/LICENSE +21 -0
- package/README.md +405 -217
- package/datalyr-react-native.podspec +31 -0
- package/ios/DatalyrNative.m +70 -0
- package/ios/DatalyrNative.swift +275 -0
- package/ios/DatalyrSKAdNetwork.m +26 -0
- package/lib/datalyr-sdk.d.ts +64 -3
- package/lib/datalyr-sdk.js +322 -3
- package/lib/index.d.ts +1 -0
- package/lib/index.js +4 -2
- package/lib/integrations/index.d.ts +6 -0
- package/lib/integrations/index.js +6 -0
- package/lib/integrations/meta-integration.d.ts +76 -0
- package/lib/integrations/meta-integration.js +218 -0
- package/lib/integrations/tiktok-integration.d.ts +82 -0
- package/lib/integrations/tiktok-integration.js +356 -0
- package/lib/native/DatalyrNativeBridge.d.ts +31 -0
- package/lib/native/DatalyrNativeBridge.js +168 -0
- package/lib/native/index.d.ts +5 -0
- package/lib/native/index.js +5 -0
- package/lib/types.d.ts +29 -0
- package/package.json +10 -5
- package/src/datalyr-sdk-expo.ts +957 -0
- package/src/datalyr-sdk.ts +419 -19
- package/src/expo.ts +38 -18
- package/src/index.ts +5 -2
- package/src/integrations/index.ts +7 -0
- package/src/integrations/meta-integration.ts +238 -0
- package/src/integrations/tiktok-integration.ts +360 -0
- package/src/native/DatalyrNativeBridge.ts +271 -0
- package/src/native/index.ts +11 -0
- package/src/types.ts +39 -0
- package/src/utils-expo.ts +25 -3
- package/src/utils-interface.ts +38 -0
- package/EXPO_INSTALL.md +0 -297
- package/INSTALL.md +0 -402
- package/examples/attribution-example.tsx +0 -377
- package/examples/auto-events-example.tsx +0 -403
- package/examples/example.tsx +0 -250
- package/examples/skadnetwork-example.tsx +0 -380
- package/examples/test-implementation.tsx +0 -163
package/CHANGELOG.md
CHANGED
|
@@ -5,155 +5,38 @@ 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.0
|
|
8
|
+
## [1.2.0] - 2025-01
|
|
9
9
|
|
|
10
|
-
###
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
### Added
|
|
11
|
+
- Bundled Meta (Facebook) SDK for iOS via native module
|
|
12
|
+
- Bundled TikTok Business SDK for iOS via native module
|
|
13
|
+
- Deferred deep link support for Meta attribution
|
|
14
|
+
- Advanced Matching support for Meta and TikTok
|
|
15
|
+
- Platform integration status methods
|
|
16
|
+
- `updateTrackingAuthorization()` for ATT handling
|
|
16
17
|
|
|
17
|
-
###
|
|
18
|
-
-
|
|
19
|
-
-
|
|
18
|
+
### Changed
|
|
19
|
+
- Native SDKs are now bundled via CocoaPods (no additional npm packages required)
|
|
20
|
+
- E-commerce events auto-forward to Meta and TikTok when available
|
|
20
21
|
|
|
21
|
-
## [1.0
|
|
22
|
+
## [1.1.0] - 2025-01
|
|
22
23
|
|
|
23
24
|
### Fixed
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
### Technical Details
|
|
29
|
-
- Root cause was Supabase Edge Function JWT setting, not SDK authentication logic
|
|
30
|
-
- SDK correctly sends `Authorization: Bearer {apiKey}` header
|
|
31
|
-
- Cloudflare Worker acts as transparent proxy to Supabase
|
|
32
|
-
- Supabase Edge Function now uses custom API key validation instead of JWT verification
|
|
33
|
-
|
|
34
|
-
## [1.0.8] - 2025-06-23
|
|
35
|
-
|
|
36
|
-
### 🔧 ENDPOINT FIX - Resolves 401 Authentication Errors
|
|
37
|
-
|
|
38
|
-
#### Changed
|
|
39
|
-
- **Endpoint Update**: Changed default endpoint from `https://datalyr-ingest.datalyr-ingest.workers.dev` to `https://app.datalyr.com/api/ingest`
|
|
40
|
-
- **Web Script Alignment**: SDK now uses the same endpoint as the web tracking script for consistency
|
|
41
|
-
|
|
42
|
-
#### Fixed
|
|
43
|
-
- **401 Unauthorized Errors**: Resolves authentication issues by using the correct production endpoint
|
|
44
|
-
- **Infrastructure Alignment**: Mobile SDK now matches web infrastructure setup
|
|
45
|
-
|
|
46
|
-
#### Technical Details
|
|
47
|
-
- No breaking changes to the API
|
|
48
|
-
- Existing API keys continue to work
|
|
49
|
-
- Automatic retry logic remains unchanged
|
|
50
|
-
- All other functionality preserved
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## [1.0.7] - 2025-06-23
|
|
55
|
-
|
|
56
|
-
### 🔄 Changed
|
|
57
|
-
- **BREAKING**: Changed automatic screen tracking event name from `screen_view` to `pageviews` for consistency with web analytics
|
|
58
|
-
- Updated session tracking to report `pageviews` instead of `screen_views` in session end events
|
|
59
|
-
- Updated session property names: `screen_views_in_session` → `pageviews_in_session`
|
|
60
|
-
|
|
61
|
-
### 🐛 Fixed
|
|
62
|
-
- Fixed session end event payload structure
|
|
63
|
-
- Improved session duration calculations
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## [1.0.6] - 2025-06-23
|
|
68
|
-
|
|
69
|
-
### 🔑 CRITICAL FIX - API Authentication Added
|
|
25
|
+
- Race condition during initialization where install event was tracked before SDK was ready
|
|
26
|
+
- Screen view events now use `pageview` (singular) to match web script
|
|
27
|
+
- Authentication issues with Supabase Edge Function JWT verification
|
|
70
28
|
|
|
71
|
-
|
|
29
|
+
### Changed
|
|
30
|
+
- SDK now uses server-side API endpoint by default
|
|
31
|
+
- API key is now required for authentication
|
|
72
32
|
|
|
73
|
-
|
|
74
|
-
- **API Key Authentication**: Added required `apiKey` field to `DatalyrConfig`
|
|
75
|
-
- **HTTP Authorization**: SDK now sends `Authorization: Bearer {apiKey}` header
|
|
76
|
-
- **401 Error Fix**: Resolves authentication errors with Datalyr API endpoints
|
|
33
|
+
## [1.0.0] - 2024
|
|
77
34
|
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
- **HttpClient**: Updated to include API key in request headers
|
|
81
|
-
- **SDK Initialization**: Now validates both `workspaceId` and `apiKey`
|
|
82
|
-
|
|
83
|
-
#### Migration Guide
|
|
84
|
-
Update your SDK initialization to include the API key:
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
// OLD (v1.0.5 and earlier)
|
|
88
|
-
await datalyr.initialize({
|
|
89
|
-
workspaceId: 'your-workspace-id'
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
// NEW (v1.0.6+) - API key required
|
|
93
|
-
await datalyr.initialize({
|
|
94
|
-
workspaceId: 'your-workspace-id',
|
|
95
|
-
apiKey: 'dk_your_api_key' // Get from Datalyr dashboard
|
|
96
|
-
});
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**Where to find your API key:**
|
|
100
|
-
- Check your web tracking script tag
|
|
101
|
-
- Look for `data-api-key="dk_..."` attribute
|
|
102
|
-
- Contact support if you need help locating it
|
|
103
|
-
|
|
104
|
-
#### Technical Details
|
|
105
|
-
- API keys follow format: `dk_` + random string
|
|
106
|
-
- Keys are safe to include in client-side code (write-only permissions)
|
|
107
|
-
- Similar to Google Analytics tracking IDs or Mixpanel project tokens
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## [1.0.5] - 2025-01-23
|
|
112
|
-
|
|
113
|
-
### 🔄 Changed
|
|
114
|
-
- **BREAKING**: Changed automatic screen tracking event name from `screen_view` to `pageviews` for consistency with web analytics
|
|
115
|
-
- Updated session tracking to report `pageviews` instead of `screen_views` in session end events
|
|
116
|
-
- Updated session property names: `screen_views_in_session` → `pageviews_in_session`
|
|
117
|
-
|
|
118
|
-
### 🐛 Fixed
|
|
119
|
-
- Fixed SDK export pattern to use singleton instance instead of class constructor
|
|
120
|
-
- Resolved white screen issues caused by incorrect import/export patterns
|
|
121
|
-
- Fixed TypeScript compilation errors in example files
|
|
122
|
-
|
|
123
|
-
### 📚 Documentation
|
|
124
|
-
- Updated all documentation to reflect `pageviews` instead of `screen_view`
|
|
125
|
-
- Updated README.md, INSTALL.md, and EXPO_INSTALL.md
|
|
126
|
-
- Updated SDK_COMPLETION_STATUS.md to show correct event names
|
|
127
|
-
- Updated example files to use correct singleton import pattern
|
|
128
|
-
- Updated example UI text to show "Pageview" instead of "Screen View"
|
|
129
|
-
|
|
130
|
-
### 🔧 Technical Details
|
|
131
|
-
- Auto-events manager now tracks `pageviews` events for screen navigation
|
|
132
|
-
- Main SDK `screen()` method now tracks `pageviews` events
|
|
133
|
-
- Maintains backward compatibility for session tracking (still counts as `screenViews` internally)
|
|
134
|
-
- Fixed import pattern: `import { datalyr } from '@datalyr/react-native-sdk'`
|
|
135
|
-
|
|
136
|
-
### 🎯 Impact
|
|
137
|
-
- **Web Analytics Consistency**: Mobile screen tracking now uses the same event name (`pageviews`) as web page tracking
|
|
138
|
-
- **Improved Developer Experience**: Fixed white screen issues and import errors
|
|
139
|
-
- **Better Analytics**: Unified event naming makes cross-platform analytics easier
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
## [1.0.2] - Previous Release
|
|
144
|
-
|
|
145
|
-
### ✨ Features
|
|
35
|
+
### Added
|
|
36
|
+
- Core event tracking with `track()`, `screen()`, `identify()`
|
|
146
37
|
- Automatic event tracking (sessions, screen views, app lifecycle)
|
|
147
|
-
-
|
|
38
|
+
- SKAdNetwork conversion value encoding with industry templates
|
|
39
|
+
- Mobile attribution tracking (UTM, click IDs)
|
|
40
|
+
- Event queue with offline support and batching
|
|
148
41
|
- React Native and Expo support
|
|
149
42
|
- TypeScript support
|
|
150
|
-
- Automatic session management
|
|
151
|
-
- App install detection
|
|
152
|
-
- Performance tracking
|
|
153
|
-
|
|
154
|
-
### 🔧 Technical
|
|
155
|
-
- Event queueing and batching
|
|
156
|
-
- Offline support
|
|
157
|
-
- Retry mechanisms
|
|
158
|
-
- Debug logging
|
|
159
|
-
- Storage persistence
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Datalyr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|