@datadog/mobile-react-native-code-push 2.2.0 → 2.3.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.
@@ -9,17 +9,8 @@ import type { UserInfo } from './sdk/UserInfoSingleton/types';
9
9
  export declare class DdSdkReactNative {
10
10
  private static readonly DD_SOURCE_KEY;
11
11
  private static readonly DD_SDK_VERSION;
12
- private static readonly DD_SERVICE_NAME;
13
- private static readonly DD_SDK_VERBOSITY_KEY;
14
- private static readonly DD_NATIVE_VIEW_TRACKING_KEY;
15
- private static readonly DD_NATIVE_INTERACTION_TRACKING_KEY;
16
12
  private static readonly DD_VERSION;
17
13
  private static readonly DD_VERSION_SUFFIX;
18
- private static readonly DD_PROXY_TYPE_KEY;
19
- private static readonly DD_PROXY_ADDRESS_KEY;
20
- private static readonly DD_PROXY_PORT_KEY;
21
- private static readonly DD_PROXY_USERNAME_KEY;
22
- private static readonly DD_PROXY_PASSWORD_KEY;
23
14
  private static wasInitialized;
24
15
  private static wasAutoInstrumented;
25
16
  private static features?;
@@ -52,6 +52,32 @@ export declare type CustomEndpoints = {
52
52
  * retro-compatibility before OTel support was introduced.
53
53
  */
54
54
  export declare const formatFirstPartyHosts: (firstPartyHosts: FirstPartyHostsConfiguration) => FirstPartyHost[];
55
+ export declare const DEFAULTS: {
56
+ nativeCrashReportEnabled: boolean;
57
+ sessionSamplingRate: number;
58
+ resourceTracingSamplingRate: number;
59
+ site: string;
60
+ longTaskThresholdMs: number;
61
+ nativeLongTaskThresholdMs: number;
62
+ nativeViewTracking: boolean;
63
+ nativeInteractionTracking: boolean;
64
+ getFirstPartyHosts: () => never[];
65
+ getAdditionalConfiguration: () => {};
66
+ trackingConsent: TrackingConsent;
67
+ telemetrySampleRate: number;
68
+ vitalsUpdateFrequency: VitalsUpdateFrequency;
69
+ logEventMapper: null;
70
+ errorEventMapper: null;
71
+ resourceEventMapper: null;
72
+ actionEventMapper: null;
73
+ trackFrustrations: boolean;
74
+ uploadFrequency: UploadFrequency;
75
+ batchSize: BatchSize;
76
+ trackBackgroundEvents: boolean;
77
+ getCustomEndpoints: () => {};
78
+ bundleLogsWithRum: boolean;
79
+ bundleLogsWithTraces: boolean;
80
+ };
55
81
  /**
56
82
  * The SDK configuration class.
57
83
  * It will be used to configure the SDK functionality at initialization.
@@ -179,6 +205,18 @@ export declare class DdSdkReactNativeConfiguration {
179
205
  * number of sessions tracked and impact your billing.
180
206
  */
181
207
  trackBackgroundEvents: boolean;
208
+ /**
209
+ * Enables RUM correlation with logs.
210
+ *
211
+ * By default, RUM is enabled for logs.
212
+ */
213
+ bundleLogsWithRum: boolean;
214
+ /**
215
+ * Enables Traces correlation with logs.
216
+ *
217
+ * By default, Traces is enabled for logs.
218
+ */
219
+ bundleLogsWithTraces: boolean;
182
220
  /**
183
221
  * Specifies a custom prop to name RUM actions on elements having an `onPress` prop.
184
222
  *
@@ -195,7 +233,7 @@ export declare class DdSdkReactNativeConfiguration {
195
233
  errorEventMapper: ErrorEventMapper | null;
196
234
  resourceEventMapper: ResourceEventMapper | null;
197
235
  actionEventMapper: ActionEventMapper | null;
198
- additionalConfig: {
236
+ additionalConfiguration: {
199
237
  [k: string]: any;
200
238
  };
201
239
  customEndpoints: CustomEndpoints;
@@ -250,7 +288,7 @@ export declare type PartialInitializationConfiguration = {
250
288
  readonly serviceName?: string;
251
289
  readonly version?: string;
252
290
  versionSuffix?: string;
253
- readonly additionalConfig?: {
291
+ readonly additionalConfiguration?: {
254
292
  [k: string]: any;
255
293
  };
256
294
  readonly trackingConsent?: TrackingConsent;
@@ -264,6 +302,8 @@ export declare type PartialInitializationConfiguration = {
264
302
  readonly batchSize?: BatchSize;
265
303
  readonly trackBackgroundEvents?: boolean;
266
304
  readonly customEndpoints?: CustomEndpoints;
305
+ readonly bundleLogsWithRum?: boolean;
306
+ readonly bundleLogsWithTraces?: boolean;
267
307
  };
268
308
  export declare const buildConfigurationFromPartialConfiguration: (features: AutoInstrumentationConfiguration, configuration: PartialInitializationConfiguration) => DdSdkReactNativeConfiguration;
269
309
  export declare class DatadogProviderConfiguration extends DdSdkReactNativeConfiguration {
@@ -273,4 +313,4 @@ export declare enum InitializationMode {
273
313
  SYNC = "SYNC",
274
314
  ASYNC = "ASYNC"
275
315
  }
276
- export declare type InitializationModeForTelemetry = 'LEGACY' | 'SYNC' | 'ASYNC' | 'PARTIAL';
316
+ export declare type InitializationModeForTelemetry = 'LEGACY' | 'SYNC' | 'ASYNC' | 'PARTIAL' | 'FILE';
@@ -14,16 +14,8 @@ declare class ProxyConfiguration {
14
14
  * Proxy port.
15
15
  */
16
16
  readonly port: number;
17
- /**
18
- * Username for Basic authentication scheme.
19
- *
20
- * Note: "SOCKS + authentication" scheme is not supported.
21
- */
22
- readonly username?: string | undefined;
23
- /**
24
- * Password for Basic authentication scheme.
25
- */
26
- readonly password?: string | undefined;
17
+ username?: string;
18
+ password?: string;
27
19
  constructor(
28
20
  /**
29
21
  * Proxy type.
@@ -42,11 +34,11 @@ declare class ProxyConfiguration {
42
34
  *
43
35
  * Note: "SOCKS + authentication" scheme is not supported.
44
36
  */
45
- username?: string | undefined,
37
+ username?: string,
46
38
  /**
47
39
  * Password for Basic authentication scheme.
48
40
  */
49
- password?: string | undefined);
41
+ password?: string);
50
42
  }
51
43
  declare enum ProxyType {
52
44
  HTTP = "http",
@@ -9,5 +9,6 @@ import { DdRum } from './rum/DdRum';
9
9
  import { DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER } from './rum/instrumentation/resourceTracking/graphql/graphqlHeaders';
10
10
  import { RumActionType, ErrorSource, PropagatorType } from './rum/types';
11
11
  import { DatadogProvider } from './sdk/DatadogProvider/DatadogProvider';
12
+ import { FileBasedConfiguration } from './sdk/FileBasedConfiguration/FileBasedConfiguration';
12
13
  import { DdTrace } from './trace/DdTrace';
13
- export { DatadogProvider, DatadogProviderConfiguration, InitializationMode, DdLogs, DdTrace, DdRum, RumActionType, ErrorSource, DdSdkReactNativeConfiguration, DdSdkReactNative, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity, VitalsUpdateFrequency, PropagatorType, UploadFrequency, BatchSize, DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER };
14
+ export { DatadogProvider, DatadogProviderConfiguration, FileBasedConfiguration, InitializationMode, DdLogs, DdTrace, DdRum, RumActionType, ErrorSource, DdSdkReactNativeConfiguration, DdSdkReactNative, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity, VitalsUpdateFrequency, PropagatorType, UploadFrequency, BatchSize, DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER };
@@ -25,8 +25,8 @@ export declare class DdNativeSdkConfiguration {
25
25
  readonly sampleRate: number;
26
26
  readonly site: string;
27
27
  readonly trackingConsent: string;
28
- readonly additionalConfig: object;
29
- constructor(clientToken: string, env: string, applicationId: string, nativeCrashReportEnabled: boolean, sampleRate: number, site: string, trackingConsent: string, additionalConfig: object);
28
+ readonly additionalConfiguration: object;
29
+ constructor(clientToken: string, env: string, applicationId: string, nativeCrashReportEnabled: boolean, sampleRate: number, site: string, trackingConsent: string, additionalConfiguration: object);
30
30
  }
31
31
  /**
32
32
  * The entry point to initialize Datadog's features.
@@ -2,13 +2,14 @@ import React from 'react';
2
2
  import type { PropsWithChildren } from 'react';
3
3
  import { DatadogProviderConfiguration } from '../../DdSdkReactNativeConfiguration';
4
4
  import type { PartialInitializationConfiguration, AutoInstrumentationConfiguration } from '../../DdSdkReactNativeConfiguration';
5
+ import type { FileBasedConfiguration } from '../FileBasedConfiguration/FileBasedConfiguration';
5
6
  declare type Props = PropsWithChildren<{
6
7
  /**
7
8
  * If a `DatadogProviderConfiguration` instance is passed, the SDK will start tracking errors, resources and actions and sending events.
8
9
  *
9
10
  * If a `AutoInstrumentationConfiguration` object is passed, the SDK will start tracking errors, resources and actions. To start sending events, call `DatadogProvider.initialize`.
10
11
  */
11
- configuration: DatadogProviderConfiguration | AutoInstrumentationConfiguration;
12
+ configuration: DatadogProviderConfiguration | AutoInstrumentationConfiguration | FileBasedConfiguration;
12
13
  /**
13
14
  * Callback to be run once the SDK starts sending events.
14
15
  */
@@ -0,0 +1,31 @@
1
+ import type { FirstPartyHostsConfiguration } from '../../DdSdkReactNativeConfiguration';
2
+ import { DatadogProviderConfiguration } from '../../DdSdkReactNativeConfiguration';
3
+ import { SdkVerbosity } from '../../SdkVerbosity';
4
+ import { TrackingConsent } from '../../TrackingConsent';
5
+ import type { ActionEventMapper } from '../../rum/eventMappers/actionEventMapper';
6
+ import type { ErrorEventMapper } from '../../rum/eventMappers/errorEventMapper';
7
+ import type { ResourceEventMapper } from '../../rum/eventMappers/resourceEventMapper';
8
+ import { PropagatorType } from '../../rum/types';
9
+ export declare class FileBasedConfiguration extends DatadogProviderConfiguration {
10
+ constructor(params?: {
11
+ configuration?: unknown;
12
+ errorEventMapper?: ErrorEventMapper;
13
+ resourceEventMapper?: ResourceEventMapper;
14
+ actionEventMapper?: ActionEventMapper;
15
+ });
16
+ }
17
+ export declare const getJSONConfiguration: (userSpecifiedConfiguration: unknown) => {
18
+ clientToken: string;
19
+ env: string;
20
+ applicationId: string;
21
+ trackInteractions: boolean | undefined;
22
+ trackResources: boolean | undefined;
23
+ trackErrors: boolean | undefined;
24
+ trackingConsent: TrackingConsent | undefined;
25
+ longTaskThresholdMs: number | undefined;
26
+ verbosity: SdkVerbosity | undefined;
27
+ actionNameAttribute: string | undefined;
28
+ resourceTracingSamplingRate: number | undefined;
29
+ firstPartyHosts: FirstPartyHostsConfiguration | undefined;
30
+ };
31
+ export declare const formatPropagatorType: (propagatorType: string) => PropagatorType;
@@ -11,7 +11,7 @@ export declare class DdSdkConfiguration {
11
11
  readonly sampleRate: number;
12
12
  readonly site: string;
13
13
  readonly trackingConsent: string;
14
- readonly additionalConfig: object;
14
+ readonly additionalConfiguration: object;
15
15
  readonly telemetrySampleRate: number;
16
16
  readonly vitalsUpdateFrequency: string;
17
17
  readonly uploadFrequency: string;
@@ -31,7 +31,24 @@ export declare class DdSdkConfiguration {
31
31
  reactVersion: string;
32
32
  reactNativeVersion: string;
33
33
  };
34
- constructor(clientToken: string, env: string, applicationId: string, nativeCrashReportEnabled: boolean, nativeLongTaskThresholdMs: number, longTaskThresholdMs: number, sampleRate: number, site: string, trackingConsent: string, additionalConfig: object, telemetrySampleRate: number, vitalsUpdateFrequency: string, uploadFrequency: string, batchSize: string, trackFrustrations: boolean, trackBackgroundEvents: boolean, customEndpoints: {
34
+ readonly nativeViewTracking: boolean;
35
+ readonly nativeInteractionTracking: boolean;
36
+ readonly verbosity: string | undefined;
37
+ readonly proxyConfig: {
38
+ type: string;
39
+ address: string;
40
+ port: number;
41
+ username?: string;
42
+ password?: string;
43
+ } | undefined;
44
+ readonly serviceName: string | undefined;
45
+ readonly firstPartyHosts: {
46
+ match: string;
47
+ propagatorTypes: string[];
48
+ }[];
49
+ readonly bundleLogsWithRum: boolean;
50
+ readonly bundleLogsWithTraces: boolean;
51
+ constructor(clientToken: string, env: string, applicationId: string, nativeCrashReportEnabled: boolean, nativeLongTaskThresholdMs: number, longTaskThresholdMs: number, sampleRate: number, site: string, trackingConsent: string, additionalConfiguration: object, telemetrySampleRate: number, vitalsUpdateFrequency: string, uploadFrequency: string, batchSize: string, trackFrustrations: boolean, trackBackgroundEvents: boolean, customEndpoints: {
35
52
  rum?: string;
36
53
  trace?: string;
37
54
  logs?: string;
@@ -42,7 +59,16 @@ export declare class DdSdkConfiguration {
42
59
  trackNetworkRequests: boolean;
43
60
  reactVersion: string;
44
61
  reactNativeVersion: string;
45
- });
62
+ }, nativeViewTracking: boolean, nativeInteractionTracking: boolean, verbosity: string | undefined, proxyConfig: {
63
+ type: string;
64
+ address: string;
65
+ port: number;
66
+ username?: string;
67
+ password?: string;
68
+ } | undefined, serviceName: string | undefined, firstPartyHosts: {
69
+ match: string;
70
+ propagatorTypes: string[];
71
+ }[], bundleLogsWithRum: boolean, bundleLogsWithTraces: boolean);
46
72
  }
47
73
  /**
48
74
  * The entry point to initialize Datadog's features.
@@ -1 +1 @@
1
- export declare const version = "2.2.0";
1
+ export declare const version = "2.3.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datadog/mobile-react-native-code-push",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "A client-side React Native module to interact with Appcenter Codepush and Datadog",
5
5
  "keywords": [
6
6
  "datadog",
@@ -38,7 +38,7 @@
38
38
  "prepare": "rm -rf lib && yarn bob build"
39
39
  },
40
40
  "devDependencies": {
41
- "@datadog/mobile-react-native": "^2.2.0",
41
+ "@datadog/mobile-react-native": "^2.3.1",
42
42
  "@testing-library/react-native": "7.0.2",
43
43
  "react-native-builder-bob": "0.17.1",
44
44
  "react-native-code-push": "7.0.5"
@@ -78,5 +78,5 @@
78
78
  ]
79
79
  ]
80
80
  },
81
- "gitHead": "dc9dbeeb115e67456bc6ab9a1dcc682c406e0a05"
81
+ "gitHead": "5908b74a76a4046ed2e6993560eb616a6500cdf7"
82
82
  }