@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
@@ -1,219 +0,0 @@
1
- /**
2
- * Meta (Facebook) SDK Integration
3
- * Uses bundled native iOS SDK for deferred deep linking, event forwarding, and Advanced Matching
4
- */
5
- import { Platform } from 'react-native';
6
- import { MetaNativeBridge, isNativeModuleAvailable } from '../native/DatalyrNativeBridge';
7
- /**
8
- * Meta Integration class for handling Facebook SDK operations
9
- * Uses native iOS SDK bundled via CocoaPods (no additional npm packages required)
10
- */
11
- export class MetaIntegration {
12
- constructor() {
13
- this.config = null;
14
- this.initialized = false;
15
- this.available = false;
16
- this.debug = false;
17
- this.deferredDeepLinkData = null;
18
- }
19
- /**
20
- * Initialize Meta SDK with configuration
21
- * Supported on both iOS and Android via native modules
22
- */
23
- async initialize(config, debug = false) {
24
- var _a;
25
- this.debug = debug;
26
- this.config = config;
27
- // Only available on iOS and Android via native modules
28
- if (Platform.OS !== 'ios' && Platform.OS !== 'android') {
29
- this.log('Meta SDK only available on iOS and Android');
30
- return;
31
- }
32
- this.available = isNativeModuleAvailable();
33
- if (!this.available) {
34
- this.log('Meta native module not available');
35
- return;
36
- }
37
- try {
38
- const success = await MetaNativeBridge.initialize(config.appId, config.clientToken, (_a = config.advertiserTrackingEnabled) !== null && _a !== void 0 ? _a : false);
39
- if (success) {
40
- this.initialized = true;
41
- this.log(`Meta SDK initialized with App ID: ${config.appId}`);
42
- }
43
- }
44
- catch (error) {
45
- this.logError('Failed to initialize Meta SDK:', error);
46
- }
47
- }
48
- /**
49
- * Update tracking authorization status (call after ATT prompt)
50
- */
51
- async updateTrackingAuthorization(enabled) {
52
- if (!this.available || !this.initialized)
53
- return;
54
- try {
55
- await MetaNativeBridge.updateTrackingAuthorization(enabled);
56
- this.log(`Meta ATT status updated: ${enabled ? 'authorized' : 'not authorized'}`);
57
- }
58
- catch (error) {
59
- this.logError('Failed to update Meta tracking authorization:', error);
60
- }
61
- }
62
- /**
63
- * Fetch deferred deep link from Meta SDK
64
- * This captures fbclid for installs that went through App Store
65
- */
66
- async fetchDeferredDeepLink() {
67
- var _a;
68
- if (!this.available || !this.initialized) {
69
- return null;
70
- }
71
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableDeferredDeepLink) === false) {
72
- return null;
73
- }
74
- try {
75
- const url = await MetaNativeBridge.fetchDeferredAppLink();
76
- if (!url) {
77
- this.log('No deferred deep link available from Meta');
78
- return null;
79
- }
80
- // Parse the URL for attribution parameters
81
- const result = this.parseDeepLinkUrl(url);
82
- this.deferredDeepLinkData = result;
83
- this.log(`Meta deferred deep link fetched: ${url}`);
84
- return result;
85
- }
86
- catch (error) {
87
- // This is expected to fail in some scenarios - log but don't treat as error
88
- this.log('Could not fetch Meta deferred deep link (may not be available)');
89
- return null;
90
- }
91
- }
92
- /**
93
- * Parse deep link URL to extract attribution parameters
94
- */
95
- parseDeepLinkUrl(urlString) {
96
- const result = {
97
- url: urlString,
98
- source: 'meta',
99
- };
100
- try {
101
- const url = new URL(urlString);
102
- const params = url.searchParams;
103
- // Extract known parameters
104
- if (params.get('fbclid'))
105
- result.fbclid = params.get('fbclid');
106
- if (params.get('utm_source'))
107
- result.utmSource = params.get('utm_source');
108
- if (params.get('utm_medium'))
109
- result.utmMedium = params.get('utm_medium');
110
- if (params.get('utm_campaign'))
111
- result.utmCampaign = params.get('utm_campaign');
112
- if (params.get('utm_content'))
113
- result.utmContent = params.get('utm_content');
114
- if (params.get('utm_term'))
115
- result.utmTerm = params.get('utm_term');
116
- if (params.get('campaign_id'))
117
- result.campaignId = params.get('campaign_id');
118
- if (params.get('adset_id'))
119
- result.adsetId = params.get('adset_id');
120
- if (params.get('ad_id'))
121
- result.adId = params.get('ad_id');
122
- }
123
- catch (error) {
124
- this.logError('Failed to parse deep link URL:', error);
125
- }
126
- return result;
127
- }
128
- /**
129
- * Log purchase event to Meta
130
- */
131
- async logPurchase(value, currency, parameters) {
132
- var _a;
133
- if (!this.available || !this.initialized)
134
- return;
135
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
136
- return;
137
- try {
138
- await MetaNativeBridge.logPurchase(value, currency, parameters);
139
- this.log(`Meta purchase event logged: ${value} ${currency}`);
140
- }
141
- catch (error) {
142
- this.logError('Failed to log Meta purchase:', error);
143
- }
144
- }
145
- /**
146
- * Log custom event to Meta
147
- */
148
- async logEvent(eventName, valueToSum, parameters) {
149
- var _a;
150
- if (!this.available || !this.initialized)
151
- return;
152
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
153
- return;
154
- try {
155
- await MetaNativeBridge.logEvent(eventName, valueToSum, parameters);
156
- this.log(`Meta event logged: ${eventName}`);
157
- }
158
- catch (error) {
159
- this.logError('Failed to log Meta event:', error);
160
- }
161
- }
162
- /**
163
- * Set user data for Advanced Matching (improves conversion attribution)
164
- * Note: Meta's Advanced Matching uses these specific fields - externalId is not supported
165
- */
166
- async setUserData(userData) {
167
- if (!this.available || !this.initialized)
168
- return;
169
- try {
170
- await MetaNativeBridge.setUserData(userData);
171
- this.log('Meta user data set for Advanced Matching');
172
- }
173
- catch (error) {
174
- this.logError('Failed to set Meta user data:', error);
175
- }
176
- }
177
- /**
178
- * Clear user data (call on logout)
179
- */
180
- async clearUserData() {
181
- if (!this.available || !this.initialized)
182
- return;
183
- try {
184
- await MetaNativeBridge.clearUserData();
185
- this.log('Meta user data cleared');
186
- }
187
- catch (error) {
188
- this.logError('Failed to clear Meta user data:', error);
189
- }
190
- }
191
- /**
192
- * Get cached deferred deep link data
193
- */
194
- getDeferredDeepLinkData() {
195
- return this.deferredDeepLinkData;
196
- }
197
- /**
198
- * Check if Meta SDK is available and initialized
199
- */
200
- isAvailable() {
201
- return this.available && this.initialized;
202
- }
203
- /**
204
- * Check if Meta SDK native module is installed
205
- */
206
- isInstalled() {
207
- return this.available;
208
- }
209
- log(message, data) {
210
- if (this.debug) {
211
- console.log(`[Datalyr/Meta] ${message}`, data || '');
212
- }
213
- }
214
- logError(message, error) {
215
- console.error(`[Datalyr/Meta] ${message}`, error);
216
- }
217
- }
218
- // Export singleton instance
219
- export const metaIntegration = new MetaIntegration();
@@ -1,83 +0,0 @@
1
- /**
2
- * TikTok Business SDK Integration
3
- * Uses bundled native iOS SDK for event forwarding and user identification
4
- */
5
- import { TikTokConfig } from '../types';
6
- /**
7
- * TikTok Integration class for handling TikTok Business SDK operations
8
- * Uses native iOS SDK bundled via CocoaPods (no additional npm packages required)
9
- */
10
- export declare class TikTokIntegration {
11
- private config;
12
- private initialized;
13
- private available;
14
- private debug;
15
- /**
16
- * Initialize TikTok SDK with configuration
17
- * Supported on both iOS and Android via native modules
18
- */
19
- initialize(config: TikTokConfig, debug?: boolean): Promise<void>;
20
- /**
21
- * Update tracking authorization status (call after ATT prompt)
22
- */
23
- updateTrackingAuthorization(enabled: boolean): Promise<void>;
24
- /**
25
- * Log purchase event to TikTok (uses Purchase - TikTok's current standard event)
26
- */
27
- logPurchase(value: number, currency: string, contentId?: string, contentType?: string, parameters?: Record<string, any>): Promise<void>;
28
- /**
29
- * Log subscription event to TikTok
30
- */
31
- logSubscription(value: number, currency: string, plan?: string): Promise<void>;
32
- /**
33
- * Log add to cart event
34
- */
35
- logAddToCart(value: number, currency: string, contentId?: string, contentType?: string): Promise<void>;
36
- /**
37
- * Log view content event
38
- */
39
- logViewContent(contentId?: string, contentName?: string, contentType?: string): Promise<void>;
40
- /**
41
- * Log initiate checkout event
42
- */
43
- logInitiateCheckout(value: number, currency: string, numItems?: number): Promise<void>;
44
- /**
45
- * Log complete registration event
46
- */
47
- logCompleteRegistration(method?: string): Promise<void>;
48
- /**
49
- * Log search event
50
- */
51
- logSearch(query: string): Promise<void>;
52
- /**
53
- * Log lead event (uses Lead - current standard, SubmitForm is legacy)
54
- */
55
- logLead(value?: number, currency?: string): Promise<void>;
56
- /**
57
- * Log add payment info event
58
- */
59
- logAddPaymentInfo(success: boolean): Promise<void>;
60
- /**
61
- * Log custom event to TikTok
62
- */
63
- trackEvent(eventName: string, properties?: Record<string, any>): Promise<void>;
64
- /**
65
- * Identify user for improved attribution matching
66
- */
67
- identify(email?: string, phone?: string, externalId?: string): Promise<void>;
68
- /**
69
- * Clear user session (call on logout)
70
- */
71
- logout(): Promise<void>;
72
- /**
73
- * Check if TikTok SDK is available and initialized
74
- */
75
- isAvailable(): boolean;
76
- /**
77
- * Check if TikTok SDK native module is installed
78
- */
79
- isInstalled(): boolean;
80
- private log;
81
- private logError;
82
- }
83
- export declare const tiktokIntegration: TikTokIntegration;
@@ -1,360 +0,0 @@
1
- /**
2
- * TikTok Business SDK Integration
3
- * Uses bundled native iOS SDK for event forwarding and user identification
4
- */
5
- import { Platform } from 'react-native';
6
- import { TikTokNativeBridge, isNativeModuleAvailable } from '../native/DatalyrNativeBridge';
7
- /**
8
- * TikTok standard event names (current as of 2025)
9
- * Note: CompletePayment and SubmitForm are legacy, use Purchase and Lead instead
10
- */
11
- const TikTokEvents = {
12
- // Commerce events
13
- PURCHASE: 'Purchase',
14
- ADD_TO_CART: 'AddToCart',
15
- ADD_TO_WISHLIST: 'AddToWishlist',
16
- INITIATE_CHECKOUT: 'InitiateCheckout',
17
- ADD_PAYMENT_INFO: 'AddPaymentInfo',
18
- VIEW_CONTENT: 'ViewContent',
19
- SEARCH: 'Search',
20
- // User events
21
- COMPLETE_REGISTRATION: 'CompleteRegistration',
22
- SUBSCRIBE: 'Subscribe',
23
- START_TRIAL: 'StartTrial',
24
- LEAD: 'Lead',
25
- CONTACT: 'Contact',
26
- // App events
27
- DOWNLOAD: 'Download',
28
- SCHEDULE: 'Schedule',
29
- SUBMIT_APPLICATION: 'SubmitApplication',
30
- };
31
- /**
32
- * TikTok Integration class for handling TikTok Business SDK operations
33
- * Uses native iOS SDK bundled via CocoaPods (no additional npm packages required)
34
- */
35
- export class TikTokIntegration {
36
- constructor() {
37
- this.config = null;
38
- this.initialized = false;
39
- this.available = false;
40
- this.debug = false;
41
- }
42
- /**
43
- * Initialize TikTok SDK with configuration
44
- * Supported on both iOS and Android via native modules
45
- */
46
- async initialize(config, debug = false) {
47
- this.debug = debug;
48
- this.config = config;
49
- // Only available on iOS and Android via native modules
50
- if (Platform.OS !== 'ios' && Platform.OS !== 'android') {
51
- this.log('TikTok SDK only available on iOS and Android');
52
- return;
53
- }
54
- this.available = isNativeModuleAvailable();
55
- if (!this.available) {
56
- this.log('TikTok native module not available');
57
- return;
58
- }
59
- try {
60
- const success = await TikTokNativeBridge.initialize(config.appId, config.tiktokAppId, config.accessToken, debug);
61
- if (success) {
62
- this.initialized = true;
63
- this.log(`TikTok SDK initialized with App ID: ${config.tiktokAppId}`);
64
- }
65
- else {
66
- console.warn('[Datalyr/TikTok] TikTok SDK not initialized (accessToken may be missing). Events will still be sent server-side via Datalyr postbacks.');
67
- }
68
- }
69
- catch (error) {
70
- console.warn('[Datalyr/TikTok] TikTok SDK init failed. Events will still be sent server-side via Datalyr postbacks.', error);
71
- }
72
- }
73
- /**
74
- * Update tracking authorization status (call after ATT prompt)
75
- */
76
- async updateTrackingAuthorization(enabled) {
77
- if (!this.available || !this.initialized)
78
- return;
79
- try {
80
- // TikTok SDK auto-handles ATT, but we track the event
81
- if (enabled) {
82
- await this.trackEvent('ATTAuthorized');
83
- }
84
- await TikTokNativeBridge.updateTrackingAuthorization(enabled);
85
- this.log(`TikTok ATT status: ${enabled ? 'authorized' : 'not authorized'}`);
86
- }
87
- catch (error) {
88
- this.logError('Failed to update TikTok tracking authorization:', error);
89
- }
90
- }
91
- /**
92
- * Log purchase event to TikTok (uses Purchase - TikTok's current standard event)
93
- */
94
- async logPurchase(value, currency, contentId, contentType, parameters) {
95
- var _a;
96
- if (!this.available || !this.initialized)
97
- return;
98
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
99
- return;
100
- try {
101
- const properties = {
102
- value,
103
- currency,
104
- ...parameters,
105
- };
106
- if (contentId)
107
- properties.content_id = contentId;
108
- if (contentType)
109
- properties.content_type = contentType;
110
- await TikTokNativeBridge.trackEvent(TikTokEvents.PURCHASE, undefined, properties);
111
- this.log(`TikTok Purchase event logged: ${value} ${currency}`);
112
- }
113
- catch (error) {
114
- this.logError('Failed to log TikTok purchase:', error);
115
- }
116
- }
117
- /**
118
- * Log subscription event to TikTok
119
- */
120
- async logSubscription(value, currency, plan) {
121
- var _a;
122
- if (!this.available || !this.initialized)
123
- return;
124
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
125
- return;
126
- try {
127
- const properties = {
128
- value,
129
- currency,
130
- };
131
- if (plan) {
132
- properties.content_id = plan;
133
- properties.content_type = 'subscription';
134
- }
135
- await TikTokNativeBridge.trackEvent(TikTokEvents.SUBSCRIBE, undefined, properties);
136
- this.log(`TikTok subscription event logged: ${value} ${currency}`);
137
- }
138
- catch (error) {
139
- this.logError('Failed to log TikTok subscription:', error);
140
- }
141
- }
142
- /**
143
- * Log add to cart event
144
- */
145
- async logAddToCart(value, currency, contentId, contentType) {
146
- var _a;
147
- if (!this.available || !this.initialized)
148
- return;
149
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
150
- return;
151
- try {
152
- const properties = {
153
- value,
154
- currency,
155
- };
156
- if (contentId)
157
- properties.content_id = contentId;
158
- if (contentType)
159
- properties.content_type = contentType;
160
- await TikTokNativeBridge.trackEvent(TikTokEvents.ADD_TO_CART, undefined, properties);
161
- this.log('TikTok add to cart event logged');
162
- }
163
- catch (error) {
164
- this.logError('Failed to log TikTok add to cart:', error);
165
- }
166
- }
167
- /**
168
- * Log view content event
169
- */
170
- async logViewContent(contentId, contentName, contentType) {
171
- var _a;
172
- if (!this.available || !this.initialized)
173
- return;
174
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
175
- return;
176
- try {
177
- const properties = {};
178
- if (contentId)
179
- properties.content_id = contentId;
180
- if (contentName)
181
- properties.content_name = contentName;
182
- if (contentType)
183
- properties.content_type = contentType;
184
- await TikTokNativeBridge.trackEvent(TikTokEvents.VIEW_CONTENT, undefined, properties);
185
- this.log('TikTok view content event logged');
186
- }
187
- catch (error) {
188
- this.logError('Failed to log TikTok view content:', error);
189
- }
190
- }
191
- /**
192
- * Log initiate checkout event
193
- */
194
- async logInitiateCheckout(value, currency, numItems) {
195
- var _a;
196
- if (!this.available || !this.initialized)
197
- return;
198
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
199
- return;
200
- try {
201
- const properties = {
202
- value,
203
- currency,
204
- };
205
- if (numItems)
206
- properties.quantity = numItems;
207
- await TikTokNativeBridge.trackEvent(TikTokEvents.INITIATE_CHECKOUT, undefined, properties);
208
- this.log('TikTok initiate checkout event logged');
209
- }
210
- catch (error) {
211
- this.logError('Failed to log TikTok initiate checkout:', error);
212
- }
213
- }
214
- /**
215
- * Log complete registration event
216
- */
217
- async logCompleteRegistration(method) {
218
- var _a;
219
- if (!this.available || !this.initialized)
220
- return;
221
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
222
- return;
223
- try {
224
- const properties = {};
225
- if (method)
226
- properties.registration_method = method;
227
- await TikTokNativeBridge.trackEvent(TikTokEvents.COMPLETE_REGISTRATION, undefined, properties);
228
- this.log('TikTok complete registration event logged');
229
- }
230
- catch (error) {
231
- this.logError('Failed to log TikTok complete registration:', error);
232
- }
233
- }
234
- /**
235
- * Log search event
236
- */
237
- async logSearch(query) {
238
- var _a;
239
- if (!this.available || !this.initialized)
240
- return;
241
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
242
- return;
243
- try {
244
- await TikTokNativeBridge.trackEvent(TikTokEvents.SEARCH, undefined, { query });
245
- this.log('TikTok search event logged');
246
- }
247
- catch (error) {
248
- this.logError('Failed to log TikTok search:', error);
249
- }
250
- }
251
- /**
252
- * Log lead event (uses Lead - current standard, SubmitForm is legacy)
253
- */
254
- async logLead(value, currency) {
255
- var _a;
256
- if (!this.available || !this.initialized)
257
- return;
258
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
259
- return;
260
- try {
261
- const properties = {};
262
- if (value !== undefined)
263
- properties.value = value;
264
- if (currency)
265
- properties.currency = currency;
266
- await TikTokNativeBridge.trackEvent(TikTokEvents.LEAD, undefined, properties);
267
- this.log('TikTok lead event logged');
268
- }
269
- catch (error) {
270
- this.logError('Failed to log TikTok lead:', error);
271
- }
272
- }
273
- /**
274
- * Log add payment info event
275
- */
276
- async logAddPaymentInfo(success) {
277
- var _a;
278
- if (!this.available || !this.initialized)
279
- return;
280
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
281
- return;
282
- try {
283
- await TikTokNativeBridge.trackEvent(TikTokEvents.ADD_PAYMENT_INFO, undefined, { success });
284
- this.log('TikTok add payment info event logged');
285
- }
286
- catch (error) {
287
- this.logError('Failed to log TikTok add payment info:', error);
288
- }
289
- }
290
- /**
291
- * Log custom event to TikTok
292
- */
293
- async trackEvent(eventName, properties) {
294
- var _a;
295
- if (!this.available || !this.initialized)
296
- return;
297
- if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAppEvents) === false)
298
- return;
299
- try {
300
- await TikTokNativeBridge.trackEvent(eventName, undefined, properties || {});
301
- this.log(`TikTok event logged: ${eventName}`);
302
- }
303
- catch (error) {
304
- this.logError('Failed to log TikTok event:', error);
305
- }
306
- }
307
- /**
308
- * Identify user for improved attribution matching
309
- */
310
- async identify(email, phone, externalId) {
311
- if (!this.available || !this.initialized)
312
- return;
313
- // Only call identify if we have at least one value
314
- if (!email && !phone && !externalId)
315
- return;
316
- try {
317
- await TikTokNativeBridge.identify(externalId, email, phone);
318
- this.log('TikTok user identification set');
319
- }
320
- catch (error) {
321
- this.logError('Failed to identify TikTok user:', error);
322
- }
323
- }
324
- /**
325
- * Clear user session (call on logout)
326
- */
327
- async logout() {
328
- if (!this.available || !this.initialized)
329
- return;
330
- try {
331
- await TikTokNativeBridge.logout();
332
- this.log('TikTok user logged out');
333
- }
334
- catch (error) {
335
- this.logError('Failed to logout TikTok user:', error);
336
- }
337
- }
338
- /**
339
- * Check if TikTok SDK is available and initialized
340
- */
341
- isAvailable() {
342
- return this.available && this.initialized;
343
- }
344
- /**
345
- * Check if TikTok SDK native module is installed
346
- */
347
- isInstalled() {
348
- return this.available;
349
- }
350
- log(message, data) {
351
- if (this.debug) {
352
- console.log(`[Datalyr/TikTok] ${message}`, data || '');
353
- }
354
- }
355
- logError(message, error) {
356
- console.error(`[Datalyr/TikTok] ${message}`, error);
357
- }
358
- }
359
- // Export singleton instance
360
- export const tiktokIntegration = new TikTokIntegration();