@datadog/mobile-react-native 2.1.1 → 2.3.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/DatadogSDKReactNative.podspec +8 -7
- package/android/build.gradle +5 -4
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogSDKWrapper.kt +2 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogWrapper.kt +11 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdLogsImplementation.kt +5 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +3 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +64 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +164 -4
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +6 -354
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +351 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +5 -3
- package/android/src/main/kotlin/com/datadog/reactnative/DdTraceImplementation.kt +10 -0
- package/android/src/main/kotlin/com/datadog/reactnative/JSONFileReader.kt +20 -0
- package/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt +4 -1
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +10 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdLogs.kt +3 -2
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +5 -2
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt +3 -2
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkConfigurationTest.kt +196 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +181 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +12 -271
- package/android/src/test/kotlin/com/datadog/reactnative/DdTraceTest.kt +10 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +28 -1
- package/android/src/test/kotlin/com/datadog/tools/unit/MapExt.kt +24 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/ActionEventForgeryFactory.kt +1 -1
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +9 -1
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/ResourceEventForgeryFactory.kt +1 -1
- package/android/src/test/resources/input/complete-configuration.json +48 -0
- package/android/src/test/resources/input/malformed-configuration.json +5 -0
- package/android/src/test/resources/input/minimal-configuration.json +8 -0
- package/datadog-configuration.gradle +57 -0
- package/datadog-configuration.schema.json +200 -0
- package/ios/Sources/DatadogSDKWrapper.swift +22 -19
- package/ios/Sources/DdLogsImplementation.swift +14 -0
- package/ios/Sources/DdSdk.h +2 -0
- package/ios/Sources/DdSdk.mm +6 -1
- package/ios/Sources/DdSdkConfiguration.swift +47 -56
- package/ios/Sources/DdSdkImplementation.swift +10 -279
- package/ios/Sources/DdSdkNativeInitialization.swift +218 -0
- package/ios/Sources/DdTraceImplementation.swift +3 -1
- package/ios/Sources/GlobalState.swift +1 -1
- package/ios/Sources/JSONFileReader.swift +28 -0
- package/ios/Sources/RNDdSdkConfiguration.swift +227 -9
- package/ios/Sources/SdkVersion.swift +10 -0
- package/lib/commonjs/DdSdkReactNative.js +24 -66
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +24 -4
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/commonjs/ProxyConfiguration.js +15 -2
- package/lib/commonjs/ProxyConfiguration.js.map +1 -1
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeModulesTypes.js +2 -2
- package/lib/commonjs/nativeModulesTypes.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js +214 -0
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +1 -0
- package/lib/commonjs/types.js +10 -2
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdSdkReactNative.js +23 -65
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +22 -4
- package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/module/ProxyConfiguration.js +15 -2
- package/lib/module/ProxyConfiguration.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/nativeModulesTypes.js +2 -2
- package/lib/module/nativeModulesTypes.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js +197 -0
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +1 -0
- package/lib/module/types.js +10 -2
- package/lib/module/types.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdSdkReactNative.d.ts +0 -9
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +43 -3
- package/lib/typescript/ProxyConfiguration.d.ts +4 -12
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/nativeModulesTypes.d.ts +2 -2
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +2 -1
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +31 -0
- package/lib/typescript/types.d.ts +29 -3
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +7 -4
- package/src/DdSdkReactNative.tsx +58 -101
- package/src/DdSdkReactNativeConfiguration.tsx +26 -7
- package/src/ProxyConfiguration.tsx +17 -3
- package/src/__tests__/DdSdkReactNative.test.tsx +134 -112
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +19 -10
- package/src/__tests__/mock.test.ts +0 -9
- package/src/index.tsx +2 -0
- package/src/nativeModulesTypes.ts +1 -1
- package/src/sdk/DatadogProvider/DatadogProvider.tsx +3 -1
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +12 -5
- package/src/sdk/DatadogProvider/__tests__/initializationModes.test.tsx +1 -2
- package/src/sdk/FileBasedConfiguration/FileBasedConfiguration.ts +235 -0
- package/src/sdk/FileBasedConfiguration/__tests__/FileBasedConfiguration.test.ts +245 -0
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/configuration-all-fields.json +22 -0
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/malformed-configuration.json +5 -0
- package/src/types.tsx +21 -2
- package/src/version.ts +1 -1
package/src/DdSdkReactNative.tsx
CHANGED
|
@@ -21,7 +21,6 @@ import type {
|
|
|
21
21
|
InitializationModeForTelemetry
|
|
22
22
|
} from './DdSdkReactNativeConfiguration';
|
|
23
23
|
import { InternalLog } from './InternalLog';
|
|
24
|
-
import { ProxyType } from './ProxyConfiguration';
|
|
25
24
|
import { SdkVerbosity } from './SdkVerbosity';
|
|
26
25
|
import type { TrackingConsent } from './TrackingConsent';
|
|
27
26
|
import { DdLogs } from './logs/DdLogs';
|
|
@@ -33,6 +32,7 @@ import { AttributesSingleton } from './sdk/AttributesSingleton/AttributesSinglet
|
|
|
33
32
|
import type { Attributes } from './sdk/AttributesSingleton/types';
|
|
34
33
|
import { BufferSingleton } from './sdk/DatadogProvider/Buffer/BufferSingleton';
|
|
35
34
|
import { DdSdk } from './sdk/DdSdk';
|
|
35
|
+
import { FileBasedConfiguration } from './sdk/FileBasedConfiguration/FileBasedConfiguration';
|
|
36
36
|
import { UserInfoSingleton } from './sdk/UserInfoSingleton/UserInfoSingleton';
|
|
37
37
|
import type { UserInfo } from './sdk/UserInfoSingleton/types';
|
|
38
38
|
import { DdSdkConfiguration } from './types';
|
|
@@ -45,22 +45,9 @@ import { version as sdkVersion } from './version';
|
|
|
45
45
|
export class DdSdkReactNative {
|
|
46
46
|
private static readonly DD_SOURCE_KEY = '_dd.source';
|
|
47
47
|
private static readonly DD_SDK_VERSION = '_dd.sdk_version';
|
|
48
|
-
private static readonly DD_SERVICE_NAME = '_dd.service_name';
|
|
49
|
-
private static readonly DD_SDK_VERBOSITY_KEY = '_dd.sdk_verbosity';
|
|
50
|
-
private static readonly DD_NATIVE_VIEW_TRACKING_KEY =
|
|
51
|
-
'_dd.native_view_tracking';
|
|
52
|
-
private static readonly DD_NATIVE_INTERACTION_TRACKING_KEY =
|
|
53
|
-
'_dd.native_interaction_tracking';
|
|
54
48
|
private static readonly DD_VERSION = '_dd.version';
|
|
55
49
|
private static readonly DD_VERSION_SUFFIX = '_dd.version_suffix';
|
|
56
50
|
|
|
57
|
-
// Proxy
|
|
58
|
-
private static readonly DD_PROXY_TYPE_KEY = '_dd.proxy.type';
|
|
59
|
-
private static readonly DD_PROXY_ADDRESS_KEY = '_dd.proxy.address';
|
|
60
|
-
private static readonly DD_PROXY_PORT_KEY = '_dd.proxy.port';
|
|
61
|
-
private static readonly DD_PROXY_USERNAME_KEY = '_dd.proxy.username';
|
|
62
|
-
private static readonly DD_PROXY_PASSWORD_KEY = '_dd.proxy.password';
|
|
63
|
-
|
|
64
51
|
private static wasInitialized = false;
|
|
65
52
|
private static wasAutoInstrumented = false;
|
|
66
53
|
private static features?: AutoInstrumentationConfiguration;
|
|
@@ -100,41 +87,8 @@ export class DdSdkReactNative {
|
|
|
100
87
|
|
|
101
88
|
InternalLog.verbosity = configuration.verbosity;
|
|
102
89
|
|
|
103
|
-
DdSdkReactNative.buildConfiguration(configuration);
|
|
104
|
-
|
|
105
90
|
await DdSdk.initialize(
|
|
106
|
-
|
|
107
|
-
configuration.clientToken,
|
|
108
|
-
configuration.env,
|
|
109
|
-
configuration.applicationId,
|
|
110
|
-
configuration.nativeCrashReportEnabled,
|
|
111
|
-
adaptLongTaskThreshold(configuration.nativeLongTaskThresholdMs),
|
|
112
|
-
adaptLongTaskThreshold(configuration.longTaskThresholdMs),
|
|
113
|
-
configuration.sampleRate === undefined
|
|
114
|
-
? configuration.sessionSamplingRate
|
|
115
|
-
: configuration.sampleRate,
|
|
116
|
-
configuration.site,
|
|
117
|
-
configuration.trackingConsent,
|
|
118
|
-
configuration.additionalConfig,
|
|
119
|
-
configuration.telemetrySampleRate,
|
|
120
|
-
configuration.vitalsUpdateFrequency,
|
|
121
|
-
configuration.uploadFrequency,
|
|
122
|
-
configuration.batchSize,
|
|
123
|
-
configuration.trackFrustrations,
|
|
124
|
-
configuration.trackBackgroundEvents,
|
|
125
|
-
configuration.customEndpoints,
|
|
126
|
-
{
|
|
127
|
-
initializationType: params.initializationModeForTelemetry,
|
|
128
|
-
trackErrors: configuration.trackErrors,
|
|
129
|
-
trackInteractions: configuration.trackInteractions,
|
|
130
|
-
trackNetworkRequests: configuration.trackResources,
|
|
131
|
-
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
132
|
-
reactNativeVersion: require('react-native/package.json')
|
|
133
|
-
.version,
|
|
134
|
-
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
135
|
-
reactVersion: require('react/package.json').version
|
|
136
|
-
}
|
|
137
|
-
)
|
|
91
|
+
DdSdkReactNative.buildConfiguration(configuration, params)
|
|
138
92
|
);
|
|
139
93
|
InternalLog.log('Datadog SDK was initialized', SdkVerbosity.INFO);
|
|
140
94
|
DdSdkReactNative.wasInitialized = true;
|
|
@@ -148,6 +102,11 @@ export class DdSdkReactNative {
|
|
|
148
102
|
configuration: DatadogProviderConfiguration
|
|
149
103
|
): Promise<void> {
|
|
150
104
|
DdSdkReactNative.enableFeatures(configuration);
|
|
105
|
+
if (configuration instanceof FileBasedConfiguration) {
|
|
106
|
+
return DdSdkReactNative.initializeNativeSDK(configuration, {
|
|
107
|
+
initializationModeForTelemetry: 'FILE'
|
|
108
|
+
});
|
|
109
|
+
}
|
|
151
110
|
if (configuration.initializationMode === InitializationMode.SYNC) {
|
|
152
111
|
return DdSdkReactNative.initializeNativeSDK(configuration, {
|
|
153
112
|
initializationModeForTelemetry: 'SYNC'
|
|
@@ -254,76 +213,74 @@ export class DdSdkReactNative {
|
|
|
254
213
|
};
|
|
255
214
|
|
|
256
215
|
private static buildConfiguration = (
|
|
257
|
-
configuration: DdSdkReactNativeConfiguration
|
|
258
|
-
|
|
259
|
-
|
|
216
|
+
configuration: DdSdkReactNativeConfiguration,
|
|
217
|
+
params: {
|
|
218
|
+
initializationModeForTelemetry: InitializationModeForTelemetry;
|
|
219
|
+
}
|
|
220
|
+
): DdSdkConfiguration => {
|
|
221
|
+
configuration.additionalConfiguration[DdSdkReactNative.DD_SOURCE_KEY] =
|
|
260
222
|
'react-native';
|
|
261
|
-
configuration.
|
|
223
|
+
configuration.additionalConfiguration[
|
|
262
224
|
DdSdkReactNative.DD_SDK_VERSION
|
|
263
225
|
] = sdkVersion;
|
|
264
|
-
configuration.additionalConfig[
|
|
265
|
-
DdSdkReactNative.DD_NATIVE_VIEW_TRACKING_KEY
|
|
266
|
-
] = configuration.nativeViewTracking;
|
|
267
|
-
configuration.additionalConfig[
|
|
268
|
-
DdSdkReactNative.DD_NATIVE_INTERACTION_TRACKING_KEY
|
|
269
|
-
] = configuration.nativeInteractionTracking;
|
|
270
|
-
|
|
271
|
-
if (configuration.verbosity) {
|
|
272
|
-
configuration.additionalConfig[
|
|
273
|
-
DdSdkReactNative.DD_SDK_VERBOSITY_KEY
|
|
274
|
-
] = configuration.verbosity;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
if (configuration.proxyConfig) {
|
|
278
|
-
const additionalConfig = configuration.additionalConfig;
|
|
279
|
-
const proxyConfig = configuration.proxyConfig;
|
|
280
|
-
|
|
281
|
-
additionalConfig[DdSdkReactNative.DD_PROXY_TYPE_KEY] =
|
|
282
|
-
proxyConfig.type;
|
|
283
|
-
additionalConfig[DdSdkReactNative.DD_PROXY_ADDRESS_KEY] =
|
|
284
|
-
proxyConfig.address;
|
|
285
|
-
additionalConfig[DdSdkReactNative.DD_PROXY_PORT_KEY] =
|
|
286
|
-
proxyConfig.port;
|
|
287
|
-
if (proxyConfig.username && proxyConfig.password) {
|
|
288
|
-
if (proxyConfig.type === ProxyType.SOCKS) {
|
|
289
|
-
console.warn(
|
|
290
|
-
"SOCKS proxy configuration doesn't support Basic authentication."
|
|
291
|
-
);
|
|
292
|
-
} else {
|
|
293
|
-
additionalConfig[DdSdkReactNative.DD_PROXY_USERNAME_KEY] =
|
|
294
|
-
proxyConfig.username;
|
|
295
|
-
additionalConfig[DdSdkReactNative.DD_PROXY_PASSWORD_KEY] =
|
|
296
|
-
proxyConfig.password;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (configuration.serviceName) {
|
|
302
|
-
configuration.additionalConfig[DdSdkReactNative.DD_SERVICE_NAME] =
|
|
303
|
-
configuration.serviceName;
|
|
304
|
-
}
|
|
305
226
|
|
|
306
227
|
if (configuration.version) {
|
|
307
|
-
configuration.
|
|
308
|
-
|
|
309
|
-
}${
|
|
228
|
+
configuration.additionalConfiguration[
|
|
229
|
+
DdSdkReactNative.DD_VERSION
|
|
230
|
+
] = `${configuration.version}${
|
|
310
231
|
configuration.versionSuffix
|
|
311
232
|
? `-${configuration.versionSuffix}`
|
|
312
233
|
: ''
|
|
313
234
|
}`;
|
|
314
235
|
}
|
|
315
|
-
|
|
316
236
|
// If both version and version suffix are provided, we merge them into the version field.
|
|
317
237
|
// To avoid adding it in again the native part, we only set it if the version isn't set.
|
|
318
238
|
if (configuration.versionSuffix && !configuration.version) {
|
|
319
|
-
configuration.
|
|
239
|
+
configuration.additionalConfiguration[
|
|
320
240
|
DdSdkReactNative.DD_VERSION_SUFFIX
|
|
321
241
|
] = `-${configuration.versionSuffix}`;
|
|
322
242
|
}
|
|
323
243
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
244
|
+
return new DdSdkConfiguration(
|
|
245
|
+
configuration.clientToken,
|
|
246
|
+
configuration.env,
|
|
247
|
+
configuration.applicationId,
|
|
248
|
+
configuration.nativeCrashReportEnabled,
|
|
249
|
+
adaptLongTaskThreshold(configuration.nativeLongTaskThresholdMs),
|
|
250
|
+
adaptLongTaskThreshold(configuration.longTaskThresholdMs),
|
|
251
|
+
configuration.sampleRate === undefined
|
|
252
|
+
? configuration.sessionSamplingRate
|
|
253
|
+
: configuration.sampleRate,
|
|
254
|
+
configuration.site,
|
|
255
|
+
configuration.trackingConsent,
|
|
256
|
+
configuration.additionalConfiguration,
|
|
257
|
+
configuration.telemetrySampleRate,
|
|
258
|
+
configuration.vitalsUpdateFrequency,
|
|
259
|
+
configuration.uploadFrequency,
|
|
260
|
+
configuration.batchSize,
|
|
261
|
+
configuration.trackFrustrations,
|
|
262
|
+
configuration.trackBackgroundEvents,
|
|
263
|
+
configuration.customEndpoints,
|
|
264
|
+
{
|
|
265
|
+
initializationType: params.initializationModeForTelemetry,
|
|
266
|
+
trackErrors: configuration.trackErrors,
|
|
267
|
+
trackInteractions: configuration.trackInteractions,
|
|
268
|
+
trackNetworkRequests: configuration.trackResources,
|
|
269
|
+
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
270
|
+
reactNativeVersion: require('react-native/package.json')
|
|
271
|
+
.version,
|
|
272
|
+
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
273
|
+
reactVersion: require('react/package.json').version
|
|
274
|
+
},
|
|
275
|
+
configuration.nativeViewTracking,
|
|
276
|
+
configuration.nativeInteractionTracking,
|
|
277
|
+
configuration.verbosity,
|
|
278
|
+
configuration.proxyConfig,
|
|
279
|
+
configuration.serviceName,
|
|
280
|
+
formatFirstPartyHosts(configuration.firstPartyHosts),
|
|
281
|
+
configuration.bundleLogsWithRum,
|
|
282
|
+
configuration.bundleLogsWithTraces
|
|
283
|
+
);
|
|
327
284
|
};
|
|
328
285
|
|
|
329
286
|
private static enableFeatures(
|
|
@@ -91,7 +91,7 @@ export const formatFirstPartyHosts = (
|
|
|
91
91
|
});
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
const DEFAULTS = {
|
|
94
|
+
export const DEFAULTS = {
|
|
95
95
|
nativeCrashReportEnabled: false,
|
|
96
96
|
sessionSamplingRate: 100.0,
|
|
97
97
|
resourceTracingSamplingRate: 20.0,
|
|
@@ -101,7 +101,7 @@ const DEFAULTS = {
|
|
|
101
101
|
nativeViewTracking: false,
|
|
102
102
|
nativeInteractionTracking: false,
|
|
103
103
|
getFirstPartyHosts: () => [],
|
|
104
|
-
|
|
104
|
+
getAdditionalConfiguration: () => ({}),
|
|
105
105
|
trackingConsent: TrackingConsent.GRANTED,
|
|
106
106
|
telemetrySampleRate: 20.0,
|
|
107
107
|
vitalsUpdateFrequency: VitalsUpdateFrequency.AVERAGE,
|
|
@@ -113,7 +113,9 @@ const DEFAULTS = {
|
|
|
113
113
|
uploadFrequency: UploadFrequency.AVERAGE,
|
|
114
114
|
batchSize: BatchSize.MEDIUM,
|
|
115
115
|
trackBackgroundEvents: false,
|
|
116
|
-
getCustomEndpoints: () => ({})
|
|
116
|
+
getCustomEndpoints: () => ({}),
|
|
117
|
+
bundleLogsWithRum: true,
|
|
118
|
+
bundleLogsWithTraces: true
|
|
117
119
|
};
|
|
118
120
|
|
|
119
121
|
/**
|
|
@@ -250,6 +252,20 @@ export class DdSdkReactNativeConfiguration {
|
|
|
250
252
|
*/
|
|
251
253
|
public trackBackgroundEvents: boolean = DEFAULTS.trackBackgroundEvents;
|
|
252
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Enables RUM correlation with logs.
|
|
257
|
+
*
|
|
258
|
+
* By default, RUM is enabled for logs.
|
|
259
|
+
*/
|
|
260
|
+
public bundleLogsWithRum: boolean = DEFAULTS.bundleLogsWithRum;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Enables Traces correlation with logs.
|
|
264
|
+
*
|
|
265
|
+
* By default, Traces is enabled for logs.
|
|
266
|
+
*/
|
|
267
|
+
public bundleLogsWithTraces: boolean = DEFAULTS.bundleLogsWithTraces;
|
|
268
|
+
|
|
253
269
|
/**
|
|
254
270
|
* Specifies a custom prop to name RUM actions on elements having an `onPress` prop.
|
|
255
271
|
*
|
|
@@ -274,9 +290,9 @@ export class DdSdkReactNativeConfiguration {
|
|
|
274
290
|
public actionEventMapper: ActionEventMapper | null =
|
|
275
291
|
DEFAULTS.actionEventMapper;
|
|
276
292
|
|
|
277
|
-
public
|
|
293
|
+
public additionalConfiguration: {
|
|
278
294
|
[k: string]: any;
|
|
279
|
-
} = DEFAULTS.
|
|
295
|
+
} = DEFAULTS.getAdditionalConfiguration();
|
|
280
296
|
|
|
281
297
|
public customEndpoints: CustomEndpoints = DEFAULTS.getCustomEndpoints();
|
|
282
298
|
|
|
@@ -371,7 +387,7 @@ export type PartialInitializationConfiguration = {
|
|
|
371
387
|
readonly serviceName?: string;
|
|
372
388
|
readonly version?: string;
|
|
373
389
|
versionSuffix?: string;
|
|
374
|
-
readonly
|
|
390
|
+
readonly additionalConfiguration?: { [k: string]: any };
|
|
375
391
|
readonly trackingConsent?: TrackingConsent;
|
|
376
392
|
readonly longTaskThresholdMs?: number | false;
|
|
377
393
|
readonly nativeLongTaskThresholdMs?: number | false;
|
|
@@ -383,6 +399,8 @@ export type PartialInitializationConfiguration = {
|
|
|
383
399
|
readonly batchSize?: BatchSize;
|
|
384
400
|
readonly trackBackgroundEvents?: boolean;
|
|
385
401
|
readonly customEndpoints?: CustomEndpoints;
|
|
402
|
+
readonly bundleLogsWithRum?: boolean;
|
|
403
|
+
readonly bundleLogsWithTraces?: boolean;
|
|
386
404
|
};
|
|
387
405
|
|
|
388
406
|
const setConfigurationAttribute = <
|
|
@@ -491,4 +509,5 @@ export type InitializationModeForTelemetry =
|
|
|
491
509
|
| 'LEGACY'
|
|
492
510
|
| 'SYNC'
|
|
493
511
|
| 'ASYNC'
|
|
494
|
-
| 'PARTIAL'
|
|
512
|
+
| 'PARTIAL'
|
|
513
|
+
| 'FILE';
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Proxy server configuration.
|
|
3
3
|
*/
|
|
4
4
|
class ProxyConfiguration {
|
|
5
|
+
username?: string;
|
|
6
|
+
password?: string;
|
|
7
|
+
|
|
5
8
|
constructor(
|
|
6
9
|
/**
|
|
7
10
|
* Proxy type.
|
|
@@ -20,12 +23,23 @@ class ProxyConfiguration {
|
|
|
20
23
|
*
|
|
21
24
|
* Note: "SOCKS + authentication" scheme is not supported.
|
|
22
25
|
*/
|
|
23
|
-
|
|
26
|
+
username?: string,
|
|
24
27
|
/**
|
|
25
28
|
* Password for Basic authentication scheme.
|
|
26
29
|
*/
|
|
27
|
-
|
|
28
|
-
) {
|
|
30
|
+
password?: string
|
|
31
|
+
) {
|
|
32
|
+
if (username && password) {
|
|
33
|
+
if (type === ProxyType.SOCKS) {
|
|
34
|
+
console.warn(
|
|
35
|
+
"SOCKS proxy configuration doesn't support Basic authentication."
|
|
36
|
+
);
|
|
37
|
+
} else {
|
|
38
|
+
this.username = username;
|
|
39
|
+
this.password = password;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
29
43
|
}
|
|
30
44
|
|
|
31
45
|
enum ProxyType {
|