@datalyr/react-native 1.0.0 → 1.0.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.
package/README.md CHANGED
@@ -1,300 +1,335 @@
1
- # 📱 Datalyr Mobile SDK
1
+ # @datalyr/react-native
2
2
 
3
- **Complete attribution tracking + automatic events for React Native & Expo**
3
+ Official Datalyr SDK for React Native & Expo - Server-side attribution tracking and analytics.
4
4
 
5
- *Like Mixpanel's automatic events + better attribution than any competitor*
5
+ [![npm version](https://img.shields.io/npm/v/@datalyr/react-native.svg)](https://www.npmjs.com/package/@datalyr/react-native)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
7
 
7
- ---
8
+ ## Features
8
9
 
9
- ## 🚨 Migration Notice
10
+ - 🔒 **Server-side tracking** - Secure API key authentication
11
+ - 📱 **React Native & Expo** - Works with both platforms
12
+ - 🎯 **Attribution tracking** - UTM, referrer, and deep links
13
+ - 📊 **SKAdNetwork** - iOS 14+ attribution support
14
+ - 💾 **Offline queue** - Events saved and retried
15
+ - 🔄 **Session management** - Automatic session tracking
16
+ - ⚡ **Performance** - < 100KB, minimal battery impact
10
17
 
11
- ### **🚀 NEW in v2.0.0: SKAdNetwork Support!**
12
- **Compete with AppsFlyer/Adjust at 90% cost savings:**
13
- - Add `skadTemplate: 'ecommerce'` to your `initialize()` call for automatic iOS 14+ attribution
14
- - Use `Datalyr.trackPurchase()` and `Datalyr.trackWithSKAdNetwork()` for conversion tracking
15
- - Choose from 3 industry templates: `'ecommerce'`, `'gaming'`, `'subscription'`
16
- - **Benefit**: Same SKAdNetwork functionality as enterprise MMPs at $49/month instead of $500/month
17
- - See [SKAdNetwork Quick Setup](#-skadnetwork-quick-setup-ios-attribution) below for details
18
+ ## Installation
18
19
 
19
- ### **v1.0.11 Changes:**
20
- **BREAKING CHANGE**: API key is now required for authentication:
21
- - Add `apiKey: 'dk_your_api_key'` to your `initialize()` call
22
- - Get your API key from your web tracking script tag (`data-api-key` attribute)
23
- - This fixes 401 authentication errors with the Datalyr API
20
+ ```bash
21
+ npm install @datalyr/react-native
22
+ # or
23
+ yarn add @datalyr/react-native
24
+ ```
24
25
 
25
- **NEW**: Attribution tracking must be explicitly enabled:
26
- - Add `enableAttribution: true` to your `initialize()` call to track deep link parameters
27
- - This enables UTM parameters, click IDs (fbclid, gclid, ttclid), and LYR tags
28
- - **Action Required**: Add this to your config to enable attribution tracking
26
+ ### Additional Dependencies
29
27
 
30
- **Previous Update (v1.0.3)**: Screen tracking events renamed for web consistency:
31
- - `screen_view` → `pageview`
32
- - **Action Required**: Update any custom analytics queries or dashboards that reference `screen_view` events
28
+ For device information and attribution:
29
+ ```bash
30
+ npm install react-native-device-info @react-native-async-storage/async-storage
31
+ ```
33
32
 
34
- ---
33
+ ### iOS Setup
35
34
 
36
- ## 🚀 Quick Start
35
+ ```bash
36
+ cd ios && pod install
37
+ ```
37
38
 
38
- **Choose your framework:**
39
+ ## Quick Start
39
40
 
40
- | Framework | Guide | Attribution Accuracy |
41
- |-----------|-------|---------------------|
42
- | **React Native CLI** | [INSTALL.md](https://github.com/datalyr/react-native-sdk/blob/main/INSTALL.md) | 100% |
43
- | **Expo Bare Workflow** | [INSTALL.md](https://github.com/datalyr/react-native-sdk/blob/main/INSTALL.md) | 100% |
44
- | **Expo Managed Workflow** | [EXPO_INSTALL.md](https://github.com/datalyr/react-native-sdk/blob/main/EXPO_INSTALL.md) | 90% |
45
- | **Expo Go** | [EXPO_INSTALL.md](https://github.com/datalyr/react-native-sdk/blob/main/EXPO_INSTALL.md) | 90% |
41
+ ```typescript
42
+ import { Datalyr } from '@datalyr/react-native';
46
43
 
47
- **❓ Not sure which to choose?** See [FRAMEWORK_COMPARISON.md](https://github.com/datalyr/react-native-sdk/blob/main/FRAMEWORK_COMPARISON.md)
44
+ // Initialize SDK
45
+ await Datalyr.initialize({
46
+ apiKey: 'dk_your_api_key', // Required - get from Datalyr dashboard
47
+ debug: true, // Enable debug logs
48
+ enableAutoEvents: true, // Track sessions, app lifecycle
49
+ enableAttribution: true, // Track attribution data
50
+ });
48
51
 
49
- **📱 For Expo users:** Core attribution (LYR tags, UTM params, click IDs) works perfectly on all Expo workflows - see [EXPO_INSTALL.md](https://github.com/datalyr/react-native-sdk/blob/main/EXPO_INSTALL.md)
52
+ // Track custom event
53
+ await Datalyr.track('Button Clicked', {
54
+ button_name: 'purchase',
55
+ value: 99.99,
56
+ });
50
57
 
51
- ---
58
+ // Identify user
59
+ await Datalyr.identify('user_123', {
60
+ email: 'user@example.com',
61
+ plan: 'premium',
62
+ });
63
+ ```
52
64
 
53
- ## ✨ What Makes This SDK Special
65
+ ## Configuration
54
66
 
55
- ### 🎯 **Complete Attribution**
56
67
  ```typescript
57
- // Tracks users from ad click to conversion
58
- // Facebook (fbclid), TikTok (ttclid), Google (gclid)
59
- // UTM parameters (utm_source, utm_medium, utm_campaign)
60
- // LYR tags (lyr, datalyr, dl_tag) - Datalyr's custom system
61
- // Deep link attribution with install detection
68
+ interface DatalyrConfig {
69
+ apiKey: string; // Required - Your API key
70
+ workspaceId?: string; // Optional - For legacy support
71
+ debug?: boolean; // Enable debug logging
72
+ endpoint?: string; // Custom API endpoint
73
+ useServerTracking?: boolean; // Default: true
74
+ enableAutoEvents?: boolean; // Track lifecycle events
75
+ enableAttribution?: boolean; // Track attribution data
76
+ skadTemplate?: 'ecommerce' | 'gaming' | 'subscription'; // SKAdNetwork
77
+ maxQueueSize?: number; // Default: 100
78
+ flushInterval?: number; // Default: 30000ms
79
+ }
62
80
  ```
63
81
 
64
- ### 📊 **SKAdNetwork Integration (iOS 14+)**
82
+ ## Core Methods
83
+
84
+ ### Initialize
65
85
  ```typescript
66
- // Automatic conversion value encoding - compete with AppsFlyer/Adjust at 90% cost savings!
67
- // ✅ Industry templates: E-commerce, Gaming, Subscription
68
- // ✅ Automatic revenue tier encoding (8 tiers: $0-1, $1-5, $5-10, $10-25, $25-50, $50-100, $100-250, $250+)
69
- // ✅ Event priority optimization for maximum attribution
70
- // ✅ Unified web + mobile analytics dashboard
86
+ await Datalyr.initialize({
87
+ apiKey: 'dk_your_api_key',
88
+ enableAutoEvents: true,
89
+ });
71
90
  ```
72
91
 
73
- ### 📊 **Automatic Events (Like Mixpanel)**
92
+ ### Track Events
74
93
  ```typescript
75
- // No manual tracking required - events happen automatically!
76
- // session_start / session_end
77
- // ✅ pageviews (automatic screen tracking)
78
- // app_foreground / app_background
79
- // ✅ app_install (with attribution data)
80
- // ✅ app_update (version changes)
81
- // ✅ app_launch_performance
82
- // ✅ revenue_event (purchase tracking)
94
+ // Simple event
95
+ await Datalyr.track('Product Viewed');
96
+
97
+ // Event with properties
98
+ await Datalyr.track('Purchase Completed', {
99
+ product_id: 'SKU123',
100
+ amount: 49.99,
101
+ currency: 'USD',
102
+ });
83
103
  ```
84
104
 
85
- ### 🔒 **Production Ready**
105
+ ### Identify Users
86
106
  ```typescript
87
- // Offline support with automatic retry
88
- // ✅ Session management (30-min timeout)
89
- // Device fingerprinting (IDFA/GAID)
90
- // ✅ Privacy compliant (GDPR/CCPA)
91
- // Works with existing Supabase backend
107
+ await Datalyr.identify('user_123', {
108
+ email: 'user@example.com',
109
+ name: 'John Doe',
110
+ plan: 'premium',
111
+ company: 'Acme Inc',
112
+ });
92
113
  ```
93
114
 
94
- ---
95
-
96
- ## 📁 Documentation & Guides
115
+ ### Track Screen Views
116
+ ```typescript
117
+ await Datalyr.screen('Product Details', {
118
+ product_id: 'SKU123',
119
+ category: 'Electronics',
120
+ });
121
+ ```
97
122
 
98
- ### **🚀 Installation Guides**
99
- - **[INSTALL.md](https://github.com/datalyr/react-native-sdk/blob/main/INSTALL.md)** - React Native CLI & Expo Bare setup
100
- - **[EXPO_INSTALL.md](https://github.com/datalyr/react-native-sdk/blob/main/EXPO_INSTALL.md)** - Expo Managed Workflow setup
101
- - **[FRAMEWORK_COMPARISON.md](https://github.com/datalyr/react-native-sdk/blob/main/FRAMEWORK_COMPARISON.md)** - Choose the right framework
123
+ ### Track Revenue
124
+ ```typescript
125
+ // Purchase tracking with SKAdNetwork
126
+ await Datalyr.trackPurchase(99.99, 'USD', 'premium_subscription');
102
127
 
103
- ### **📊 Feature Documentation**
104
- - **[SDK_COMPLETION_STATUS.md](https://github.com/datalyr/react-native-sdk/blob/main/SDK_COMPLETION_STATUS.md)** - What's included vs competitors
105
- - **[test-app/](https://github.com/datalyr/react-native-sdk/tree/main/test-app)** - 🧪 **Complete test app** - Ready-to-run Expo app demonstrating all features
106
- - **[examples/skadnetwork-example.tsx](https://github.com/datalyr/react-native-sdk/blob/main/examples/skadnetwork-example.tsx)** - 🚀 **SKAdNetwork demo** - Complete interface for testing all templates
107
- - **[examples/auto-events-example.tsx](https://github.com/datalyr/react-native-sdk/blob/main/examples/auto-events-example.tsx)** - Live demo of automatic events
108
- - **[examples/attribution-example.tsx](https://github.com/datalyr/react-native-sdk/blob/main/examples/attribution-example.tsx)** - Attribution testing interface
109
- - **[examples/example.tsx](https://github.com/datalyr/react-native-sdk/blob/main/examples/example.tsx)** - Basic SDK usage example
128
+ // Subscription tracking
129
+ await Datalyr.trackSubscription(9.99, 'USD', 'monthly_pro');
110
130
 
111
- ### **🔧 SDK Files**
112
- - **[src/](https://github.com/datalyr/react-native-sdk/tree/main/src)** - Complete SDK source code
113
- - **[package.json](https://github.com/datalyr/react-native-sdk/blob/main/package.json)** - Dependencies and configuration
131
+ // Custom revenue event
132
+ await Datalyr.trackRevenue('In-App Purchase', {
133
+ product_id: 'coins_1000',
134
+ amount: 4.99,
135
+ currency: 'USD',
136
+ });
137
+ ```
114
138
 
115
- ---
139
+ ## Attribution Tracking
116
140
 
117
- ## 🎯 30-Second Integration
141
+ The SDK automatically tracks:
142
+ - Deep links and Universal Links
143
+ - UTM parameters
144
+ - Referrer data
145
+ - Install attribution
146
+ - Platform click IDs (fbclid, gclid, ttclid, etc.)
118
147
 
119
- **Basic Setup:**
148
+ ### Get Attribution Data
120
149
  ```typescript
121
- import { datalyr } from '@datalyr/react-native-sdk';
122
-
123
- // Initialize with automatic events
124
- await datalyr.initialize({
125
- workspaceId: 'your-workspace-id',
126
- apiKey: 'dk_your_api_key', // Required for authentication
127
- enableAttribution: true, // ✅ Deep link attribution tracking
128
- autoEvents: {
129
- trackSessions: true, // ✅ Session start/end
130
- trackScreenViews: true, // ✅ Automatic screen tracking
131
- trackAppUpdates: true, // ✅ App version changes
132
- trackPerformance: true, // ✅ App launch performance
133
- },
134
- });
135
-
136
- // Manual events still work (but many are now automatic!)
137
- await datalyr.track('purchase', { value: 29.99, currency: 'USD' });
138
- await datalyr.identify('user_123', { email: 'user@example.com' });
139
- await datalyr.screen('home_screen');
150
+ const attribution = Datalyr.getAttributionData();
151
+ console.log(attribution);
152
+ // {
153
+ // campaign: 'summer_sale',
154
+ // source: 'facebook',
155
+ // medium: 'social',
156
+ // fbclid: 'abc123',
157
+ // ...
158
+ // }
140
159
  ```
141
160
 
142
- **🚀 NEW: SKAdNetwork Setup (iOS 14+ Attribution):**
161
+ ### Set Custom Attribution
143
162
  ```typescript
144
- import { Datalyr } from '@datalyr/react-native-sdk';
145
-
146
- // Initialize with SKAdNetwork for iOS attribution
147
- await Datalyr.initialize({
148
- workspaceId: 'your-workspace-id',
149
- apiKey: 'dk_your_api_key',
150
- skadTemplate: 'ecommerce', // 'ecommerce', 'gaming', or 'subscription'
151
- enableAttribution: true,
152
- autoEvents: { trackSessions: true, trackScreenViews: true },
163
+ await Datalyr.setAttributionData({
164
+ campaign: 'email_campaign',
165
+ source: 'newsletter',
166
+ medium: 'email',
153
167
  });
154
-
155
- // Track events with automatic SKAdNetwork encoding
156
- await Datalyr.trackPurchase(29.99, 'USD', 'premium_plan');
157
- await Datalyr.trackWithSKAdNetwork('add_to_cart', { product_id: 'shirt_001' });
158
-
159
- // 🎉 Automatic conversion value encoding sends to Apple!
160
168
  ```
161
169
 
162
- ## 🧪 **Want to Test First?**
170
+ ## Session Management
163
171
 
164
- Try our complete test app before integrating:
172
+ Sessions are tracked automatically with a 30-minute timeout.
165
173
 
166
- ```bash
167
- # Clone the repository
168
- git clone https://github.com/datalyr/react-native-sdk.git
169
- cd react-native-sdk/test-app
174
+ ```typescript
175
+ // Get current session
176
+ const session = Datalyr.getCurrentSession();
177
+
178
+ // Manually end session
179
+ await Datalyr.endSession();
170
180
 
171
- # Install and run
172
- npm install
173
- npx expo start
181
+ // Reset user (logout)
182
+ await Datalyr.reset();
174
183
  ```
175
184
 
176
- The test app demonstrates all SDK features with real-time logging!
185
+ ## SKAdNetwork Support (iOS)
177
186
 
178
- ---
187
+ Enable SKAdNetwork conversion value tracking:
179
188
 
180
- ## 📈 What You Get in Your Dashboard
189
+ ```typescript
190
+ await Datalyr.initialize({
191
+ apiKey: 'dk_your_api_key',
192
+ skadTemplate: 'ecommerce', // or 'gaming', 'subscription'
193
+ });
181
194
 
182
- Events appear in your Datalyr dashboard with `source: 'mobile_app'`:
195
+ // Events automatically update conversion values
196
+ await Datalyr.trackPurchase(99.99, 'USD');
183
197
 
184
- ### **🔥 Automatic Events (Zero Code)**
185
- - `session_start` - User starts new session with attribution
186
- - `session_end` - Session ends with duration and screen count
187
- - `pageview` - User navigates between screens
188
- - `app_install` - First app launch with full attribution
189
- - `app_update` - App version changes
190
- - `app_foreground` - App becomes active
191
- - `app_background` - App goes to background
192
- - `app_launch_performance` - App startup timing
193
- - `revenue_event` - Purchase/subscription tracking
198
+ // Get conversion value for testing
199
+ const value = Datalyr.getConversionValue('purchase', { revenue: 50 });
200
+ console.log('Conversion value:', value); // 0-63
201
+ ```
194
202
 
195
- ### **📱 Manual Events (When You Call Them)**
196
- - Custom events from `datalyr.track()`
197
- - User identification from `datalyr.identify()`
198
- - Manual screen views from `datalyr.screen()`
203
+ ## Automatic Events
199
204
 
200
- ---
205
+ When `enableAutoEvents` is true, the SDK tracks:
201
206
 
202
- ## 🏆 vs. Enterprise MMPs
207
+ - `app_install` - First app open
208
+ - `app_open` - App launches
209
+ - `app_background` - App enters background
210
+ - `app_foreground` - App returns to foreground
211
+ - `app_update` - App version changes
212
+ - `session_start` - New session begins
213
+ - `session_end` - Session expires
203
214
 
204
- | Feature | AppsFlyer | Adjust | Mixpanel | **Datalyr** |
205
- |---------|-----------|--------|----------|-------------|
206
- | SKAdNetwork | ✅ ($300/mo) | ✅ ($500/mo) | ❌ | **✅ ($49/mo)** |
207
- | Attribution | ✅ | ✅ | ❌ | **✅** |
208
- | Auto Events | ❌ | ❌ | ✅ | **✅** |
209
- | Web + Mobile | ❌ | ❌ | ✅ | **✅** |
210
- | Revenue Optimization | ✅ | ✅ | ✅ | **✅** |
211
- | Industry Templates | ✅ | ✅ | ❌ | **✅** |
212
- | Cost | $300-3000/mo | $500-5000/mo | $20-2000/mo | **$49-499/mo** |
215
+ ## Offline Support
213
216
 
214
- **🎯 Datalyr Advantage:** Same SKAdNetwork functionality as enterprise MMPs at 90% cost savings + unified web analytics!
217
+ Events are automatically queued when offline and sent when connection is restored.
215
218
 
216
- ---
219
+ ```typescript
220
+ // Manually flush queue
221
+ await Datalyr.flush();
217
222
 
218
- ## 🎮 Try the Demo
223
+ // Get queue status
224
+ const status = Datalyr.getStatus();
225
+ console.log('Queue size:', status.queueStats.queueSize);
226
+ ```
219
227
 
220
- Want to see all features in action?
228
+ ## Debug Mode
221
229
 
222
- 1. **🚀 SKAdNetwork Demo:** Try [examples/skadnetwork-example.tsx](https://github.com/datalyr/react-native-sdk/blob/main/examples/skadnetwork-example.tsx) - Test all industry templates with real-time conversion values
223
- 2. **🧪 Complete Test App:** Run the [test-app/](https://github.com/datalyr/react-native-sdk/tree/main/test-app) - Full Expo app with all features
224
- 3. **Auto Events Demo:** Run [examples/auto-events-example.tsx](https://github.com/datalyr/react-native-sdk/blob/main/examples/auto-events-example.tsx)
225
- 4. **Attribution Testing:** Use [examples/attribution-example.tsx](https://github.com/datalyr/react-native-sdk/blob/main/examples/attribution-example.tsx)
226
- 5. **Basic Integration:** Check out [examples/example.tsx](https://github.com/datalyr/react-native-sdk/blob/main/examples/example.tsx)
230
+ Enable debug logging during development:
227
231
 
228
- ---
232
+ ```typescript
233
+ await Datalyr.initialize({
234
+ apiKey: 'dk_your_api_key',
235
+ debug: true, // Enable console logs
236
+ });
237
+ ```
229
238
 
230
- ## 🚀 Ready to Start?
239
+ ## TypeScript Support
231
240
 
232
- 1. **📖 Choose your guide:** [FRAMEWORK_COMPARISON.md](https://github.com/datalyr/react-native-sdk/blob/main/FRAMEWORK_COMPARISON.md)
233
- 2. **⚡ Quick install:** [INSTALL.md](https://github.com/datalyr/react-native-sdk/blob/main/INSTALL.md) or [EXPO_INSTALL.md](https://github.com/datalyr/react-native-sdk/blob/main/EXPO_INSTALL.md)
234
- 3. **🧪 Test attribution:** Your events appear at `https://app.datalyr.com`
235
- 4. **🎉 Launch:** Start tracking users from ad click to conversion!
241
+ Full TypeScript support with type definitions included:
236
242
 
237
- ---
243
+ ```typescript
244
+ import {
245
+ Datalyr,
246
+ DatalyrConfig,
247
+ EventData,
248
+ UserProperties,
249
+ AttributionData
250
+ } from '@datalyr/react-native';
251
+ ```
238
252
 
239
- **🔥 The only mobile SDK that combines SKAdNetwork attribution + automatic events + unified web analytics!**
253
+ ## Expo Support
240
254
 
241
- *Compete with AppsFlyer/Adjust at 90% cost savings while getting Mixpanel-style automatic events!*
255
+ Works with Expo managed and bare workflows:
242
256
 
243
- ---
257
+ ```typescript
258
+ // expo.config.js
259
+ export default {
260
+ plugins: [
261
+ // No additional config needed
262
+ ],
263
+ };
264
+ ```
244
265
 
245
- ## 🚀 SKAdNetwork Quick Setup (iOS Attribution)
266
+ ## Migration from v0.x
246
267
 
247
- ### **1. Add Native Bridge (React Native CLI/Expo Bare):**
268
+ If migrating from an older version:
248
269
 
249
- Create `ios/YourApp/DatalyrSKAdNetwork.m`:
250
- ```objc
251
- #import <React/RCTBridgeModule.h>
252
- #import <StoreKit/StoreKit.h>
270
+ ```typescript
271
+ // Old (v0.x)
272
+ import datalyr from '@datalyr/react-native-sdk';
273
+ datalyr.initialize({ workspaceId: 'ws_123' });
253
274
 
254
- @interface DatalyrSKAdNetwork : NSObject <RCTBridgeModule>
255
- @end
275
+ // New (v1.0+)
276
+ import { Datalyr } from '@datalyr/react-native';
277
+ await Datalyr.initialize({ apiKey: 'dk_your_api_key' });
278
+ ```
256
279
 
257
- @implementation DatalyrSKAdNetwork
258
- RCT_EXPORT_MODULE();
280
+ ## API Reference
281
+
282
+ ### Methods
283
+
284
+ | Method | Description |
285
+ |--------|-------------|
286
+ | `initialize(config)` | Initialize SDK with configuration |
287
+ | `track(event, properties?)` | Track custom event |
288
+ | `identify(userId, properties?)` | Identify user |
289
+ | `screen(name, properties?)` | Track screen view |
290
+ | `alias(newUserId, previousId?)` | Create user alias |
291
+ | `reset()` | Reset user session |
292
+ | `flush()` | Flush event queue |
293
+ | `getStatus()` | Get SDK status |
294
+ | `getAttributionData()` | Get attribution data |
295
+ | `setAttributionData(data)` | Set attribution data |
296
+ | `getCurrentSession()` | Get current session |
297
+ | `endSession()` | End current session |
298
+ | `trackPurchase(value, currency, productId?)` | Track purchase |
299
+ | `trackSubscription(value, currency, plan?)` | Track subscription |
300
+ | `trackRevenue(event, properties?)` | Track revenue event |
301
+
302
+ ## Troubleshooting
303
+
304
+ ### Events not appearing?
305
+ 1. Check your API key is correct
306
+ 2. Enable debug mode to see logs
307
+ 3. Verify network connectivity
308
+ 4. Check `getStatus()` for queue information
309
+
310
+ ### Authentication errors?
311
+ - Ensure API key starts with `dk_`
312
+ - Get your API key from: https://app.datalyr.com/settings/api-keys
313
+
314
+ ### Build errors?
315
+ ```bash
316
+ # Clear caches
317
+ npx react-native clean-project
259
318
 
260
- RCT_EXPORT_METHOD(updateConversionValue:(NSInteger)value
261
- resolve:(RCTPromiseResolveBlock)resolve
262
- reject:(RCTPromiseRejectBlock)reject) {
263
- if (@available(iOS 14.0, *)) {
264
- [SKAdNetwork updateConversionValue:value];
265
- resolve(@(YES));
266
- } else {
267
- reject(@"ios_version_error", @"SKAdNetwork requires iOS 14.0+", nil);
268
- }
269
- }
270
- @end
319
+ # iOS specific
320
+ cd ios && pod install
271
321
  ```
272
322
 
273
- ### **2. Initialize with Template:**
274
- ```typescript
275
- import { Datalyr } from '@datalyr/react-native-sdk';
323
+ ## Support
276
324
 
277
- await Datalyr.initialize({
278
- workspaceId: 'your-workspace-id',
279
- apiKey: 'your-api-key',
280
- skadTemplate: 'ecommerce', // Choose: 'ecommerce', 'gaming', 'subscription'
281
- });
282
- ```
325
+ - 📧 Email: support@datalyr.com
326
+ - 📚 Docs: https://docs.datalyr.com
327
+ - 🐛 Issues: https://github.com/datalyr/react-native/issues
283
328
 
284
- ### **3. Track Events:**
285
- ```typescript
286
- // Automatic SKAdNetwork encoding for iOS 14+
287
- await Datalyr.trackPurchase(29.99, 'USD', 'premium_plan');
288
- await Datalyr.trackWithSKAdNetwork('add_to_cart', { product_id: 'shirt_001' });
329
+ ## License
289
330
 
290
- // Test conversion values (doesn't send to Apple)
291
- const value = Datalyr.getConversionValue('purchase', { revenue: 29.99 });
292
- console.log('Conversion value:', value); // Example: 5
293
- ```
331
+ MIT © Datalyr
294
332
 
295
- ### **4. Revenue Encoding:**
296
- The SDK automatically maps revenue to 8 optimized tiers:
297
- - $0-1 → Tier 0, $1-5 → Tier 1, $5-10 → Tier 2, $10-25 → Tier 3
298
- - $25-50 → Tier 4, $50-100 → Tier 5, $100-250 → Tier 6, $250+ → Tier 7
333
+ ---
299
334
 
300
- **🎯 Result:** Same attribution as AppsFlyer/Adjust at $49/month instead of $500/month!
335
+ Built with ❤️ by [Datalyr](https://datalyr.com)
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { Button, View, Text, StyleSheet } from 'react-native';
3
- import { Datalyr } from '@datalyr/react-native-sdk';
3
+ import { Datalyr } from '@datalyr/react-native';
4
4
 
5
5
  // Initialize SDK with server-side API
6
6
  const initializeSDK = async () => {
@@ -121,7 +121,7 @@ export class DatalyrSDK {
121
121
  const installData = await attributionManager.trackInstall();
122
122
  await this.track('app_install', {
123
123
  platform: Platform.OS === 'ios' || Platform.OS === 'android' ? Platform.OS : 'android',
124
- sdk_version: '1.0.0',
124
+ sdk_version: '1.0.1',
125
125
  ...installData,
126
126
  });
127
127
  }
@@ -45,7 +45,7 @@ export class HttpClient {
45
45
  const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);
46
46
  const headers = {
47
47
  'Content-Type': 'application/json',
48
- 'User-Agent': `@datalyr/react-native/1.0.0`,
48
+ 'User-Agent': `@datalyr/react-native/1.0.1`,
49
49
  };
50
50
  // Server-side tracking uses X-API-Key header
51
51
  if (this.config.useServerTracking !== false) {
@@ -151,8 +151,8 @@ export class HttpClient {
151
151
  fingerprint: payload.fingerprintData,
152
152
  },
153
153
  context: {
154
- library: 'datalyr-react-native',
155
- version: '1.0.0',
154
+ library: '@datalyr/react-native',
155
+ version: '1.0.1',
156
156
  userProperties: payload.userProperties,
157
157
  },
158
158
  timestamp: payload.timestamp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalyr/react-native",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Datalyr SDK for React Native & Expo - Server-side attribution tracking",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -166,7 +166,7 @@ export class DatalyrSDK {
166
166
  const installData = await attributionManager.trackInstall();
167
167
  await this.track('app_install', {
168
168
  platform: Platform.OS === 'ios' || Platform.OS === 'android' ? Platform.OS : 'android',
169
- sdk_version: '1.0.0',
169
+ sdk_version: '1.0.1',
170
170
  ...installData,
171
171
  });
172
172
  }
@@ -72,7 +72,7 @@ export class HttpClient {
72
72
 
73
73
  const headers: Record<string, string> = {
74
74
  'Content-Type': 'application/json',
75
- 'User-Agent': `@datalyr/react-native/1.0.0`,
75
+ 'User-Agent': `@datalyr/react-native/1.0.1`,
76
76
  };
77
77
 
78
78
  // Server-side tracking uses X-API-Key header
@@ -196,8 +196,8 @@ export class HttpClient {
196
196
  fingerprint: payload.fingerprintData,
197
197
  },
198
198
  context: {
199
- library: 'datalyr-react-native',
200
- version: '1.0.0',
199
+ library: '@datalyr/react-native',
200
+ version: '1.0.1',
201
201
  userProperties: payload.userProperties,
202
202
  },
203
203
  timestamp: payload.timestamp,