@dynatrace/react-native-plugin 2.329.1 → 2.333.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/README.md +102 -8
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.kt +7 -1
  4. package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.kt +1 -0
  5. package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +1 -0
  6. package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +2 -1
  7. package/files/plugin.gradle +1 -1
  8. package/instrumentation/DynatraceInstrumentation.js +1 -1
  9. package/instrumentation/jsx/CreateElement.js +106 -6
  10. package/instrumentation/jsx/JsxDevRuntime.js +2 -6
  11. package/instrumentation/jsx/JsxRuntime.js +2 -6
  12. package/instrumentation/libs/withOnPressMonitoring.js +49 -3
  13. package/ios/DynatraceRNBridge.mm +8 -1
  14. package/lib/core/Application.js +2 -0
  15. package/lib/core/Dynatrace.js +2 -1
  16. package/lib/core/UserPrivacyOptions.js +8 -1
  17. package/lib/core/configuration/ConfigurationHandler.js +21 -0
  18. package/lib/features/ui-interaction/Config.js +36 -0
  19. package/lib/features/ui-interaction/IUserInteractionEvent.js +16 -0
  20. package/lib/features/ui-interaction/Plugin.js +945 -0
  21. package/lib/features/ui-interaction/RootDetection.js +51 -0
  22. package/lib/features/ui-interaction/RootWrapper.js +236 -0
  23. package/lib/features/ui-interaction/Run.js +34 -0
  24. package/lib/features/ui-interaction/Runtime.js +1494 -0
  25. package/lib/features/ui-interaction/Types.js +75 -0
  26. package/lib/next/Dynatrace.js +35 -0
  27. package/lib/next/DynatraceArgValidators.js +10 -0
  28. package/lib/next/configuration/INativeRuntimeConfiguration.js +1 -0
  29. package/lib/next/configuration/RuntimeConfigurationObserver.js +47 -12
  30. package/lib/next/events/EventPipeline.js +9 -0
  31. package/lib/next/events/HttpRequestEventData.js +22 -20
  32. package/lib/next/events/modifier/ModifyEventValidation.js +2 -4
  33. package/lib/next/events/spec/EventSpecContstants.js +2 -2
  34. package/package.json +21 -11
  35. package/react-native-dynatrace.podspec +1 -1
  36. package/scripts/Config.js +1 -0
  37. package/src/lib/core/interface/NativeDynatraceBridge.ts +1 -0
  38. package/types.d.ts +46 -32
package/types.d.ts CHANGED
@@ -126,11 +126,13 @@ declare enum DataCollectionLevel {
126
126
  declare class UserPrivacyOptions {
127
127
  private _dataCollectionLevel;
128
128
  private _crashReportingOptedIn;
129
+ private _screenRecordOptedIn;
129
130
  /**
130
131
  * Creates a new UserPrivacyOptions instance with the specified privacy settings.
131
132
  *
132
133
  * @param {DataCollectionLevel} dataCollectionLevel The level of data collection to allow
133
134
  * @param {boolean} crashReportingOptedIn Whether crash reporting should be enabled
135
+ * @param {boolean} screenRecordOptedIn Whether screen recording (Session Replay) should be enabled
134
136
  *
135
137
  * @example
136
138
  * ```ts
@@ -147,7 +149,7 @@ declare class UserPrivacyOptions {
147
149
  *
148
150
  * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
149
151
  */
150
- constructor(dataCollectionLevel: DataCollectionLevel, crashReportingOptedIn: boolean);
152
+ constructor(dataCollectionLevel: DataCollectionLevel, crashReportingOptedIn: boolean, screenRecordOptedIn?: boolean);
151
153
  /**
152
154
  * Gets the current data collection level.
153
155
  *
@@ -216,6 +218,8 @@ declare class UserPrivacyOptions {
216
218
  * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
217
219
  */
218
220
  set dataCollectionLevel(dataCollectionLevel: DataCollectionLevel);
221
+ get screenRecordOptedIn(): boolean;
222
+ set screenRecordOptedIn(screenRecordOptedIn: boolean);
219
223
  }
220
224
 
221
225
  /**
@@ -394,15 +398,16 @@ interface IDynatraceAction {
394
398
  */
395
399
  cancel(platform?: Platform): void;
396
400
  /**
397
- * Generates a Dynatrace request tag for manual web request tagging. This tag must be added as an
398
- * HTTP header to link the web request with this mobile action. The header key can be obtained
399
- * using `getRequestTagHeader()`.
401
+ * Generates a unique x-dynatrace header for the web request with a specified url,
402
+ * which has to be manually added as http header.
400
403
  *
401
- * The tag value is evaluated by the Dynatrace web server agent, which links server-side PurePath
402
- * data with this mobile user action for end-to-end tracing.
404
+ * This is the same tag that was provided when constructing the DynatraceWebRequestTiming instance.
405
+ * The header key can be obtained with the method getRequestTagHeader.
403
406
  *
404
- * **Note:** The returned string may be empty if the Dynatrace agent is disabled or not started yet,
405
- * if communication with the Dynatrace server fails, or if privacy settings do not allow monitoring of requests.
407
+ * The string value can be empty in cases when the agent is not able to send data, the agent is turned off completly,
408
+ * has not started yet or is not allowed to track web requests because of privacy reasons.
409
+ * The tag value is evaluated by the corresponding web server agent.
410
+ * The Dynatrace server will link the server-side PurePath data with this mobile user action.
406
411
  *
407
412
  * @param {string} url The URL of the request you want to track
408
413
  * @returns {Promise<string>} The request tag value to be used as the HTTP header value
@@ -636,7 +641,7 @@ interface IEventModifier {
636
641
  * }});
637
642
  * ```
638
643
  *
639
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
644
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-custom-events#event-modifiers
640
645
  */
641
646
  modifyEvent(event: JSONObject): JSONObject | null;
642
647
  }
@@ -676,7 +681,7 @@ interface IHttpRequestEventData extends IBaseEvent {
676
681
  * Dynatrace.sendHttpRequestEvent(requestEvent);
677
682
  * ```
678
683
  *
679
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
684
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-web-request-performance#manual-http-request-reporting
680
685
  */
681
686
  withDuration(duration: number): this;
682
687
  /**
@@ -694,7 +699,7 @@ interface IHttpRequestEventData extends IBaseEvent {
694
699
  * Dynatrace.sendHttpRequestEvent(requestEvent);
695
700
  * ```
696
701
  *
697
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
702
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-web-request-performance#manual-http-request-reporting
698
703
  */
699
704
  withStatusCode(statusCode: number): this;
700
705
  /**
@@ -712,7 +717,7 @@ interface IHttpRequestEventData extends IBaseEvent {
712
717
  * Dynatrace.sendHttpRequestEvent(requestEvent);
713
718
  * ```
714
719
  *
715
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
720
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-web-request-performance#manual-http-request-reporting
716
721
  */
717
722
  withReasonPhrase(reasonPhrase: string): this;
718
723
  /**
@@ -738,7 +743,7 @@ interface IHttpRequestEventData extends IBaseEvent {
738
743
  * }
739
744
  * ```
740
745
  *
741
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
746
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-web-request-performance#manual-http-request-reporting
742
747
  */
743
748
  withError(error: Error): this;
744
749
  /**
@@ -756,7 +761,7 @@ interface IHttpRequestEventData extends IBaseEvent {
756
761
  * Dynatrace.sendHttpRequestEvent(requestEvent);
757
762
  * ```
758
763
  *
759
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
764
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-web-request-performance#manual-http-request-reporting
760
765
  */
761
766
  withBytesSent(bytesSent: number): this;
762
767
  /**
@@ -774,7 +779,7 @@ interface IHttpRequestEventData extends IBaseEvent {
774
779
  * Dynatrace.sendHttpRequestEvent(requestEvent);
775
780
  * ```
776
781
  *
777
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
782
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-web-request-performance#manual-http-request-reporting
778
783
  */
779
784
  withBytesReceived(bytesReceived: number): this;
780
785
  /**
@@ -793,7 +798,7 @@ interface IHttpRequestEventData extends IBaseEvent {
793
798
  * Dynatrace.sendHttpRequestEvent(requestEvent);
794
799
  * ```
795
800
  *
796
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
801
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-web-request-performance#manual-http-request-reporting
797
802
  */
798
803
  withTraceparentHeader(traceparentHeader: TraceparentHeader): this;
799
804
  /**
@@ -822,13 +827,15 @@ interface IHttpRequestEventData extends IBaseEvent {
822
827
  * Dynatrace.sendHttpRequestEvent(requestEvent);
823
828
  * ```
824
829
  *
825
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
830
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-web-request-performance#manual-http-request-reporting
826
831
  */
827
832
  addEventProperty(key: `event_properties.${string}`, value: EventProperty): this;
828
833
  }
829
834
 
830
835
  type TraceparentHeader = `00-${string}-${string}-0${'0' | '1'}`;
831
836
  type AllowedRequestMethods = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH' | 'get' | 'head' | 'post' | 'put' | 'delete' | 'connect' | 'options' | 'trace' | 'patch';
837
+ type Url = `http://${string}` | `https://${string}`;
838
+ type EventPropertyKey = `event_properties.${string}`;
832
839
  declare class HttpRequestEventData implements IHttpRequestEventData {
833
840
  private url;
834
841
  private requestMethod;
@@ -841,7 +848,6 @@ declare class HttpRequestEventData implements IHttpRequestEventData {
841
848
  private error?;
842
849
  private traceparentHeader?;
843
850
  private rawEventProperties;
844
- private traceContextHint;
845
851
  private hasDroppedProperties;
846
852
  private triedToOverwriteDuration;
847
853
  /**
@@ -860,9 +866,9 @@ declare class HttpRequestEventData implements IHttpRequestEventData {
860
866
  * Dynatrace.sendHttpRequestEvent(requestEvent);
861
867
  * ```
862
868
  *
863
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
869
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-web-request-performance#manual-http-request-reporting
864
870
  */
865
- constructor(url: `http://${string}` | `https://${string}`, requestMethod: AllowedRequestMethods);
871
+ constructor(url: Url, requestMethod: AllowedRequestMethods);
866
872
  withDuration(duration: number): this;
867
873
  withStatusCode(statusCode: number): this;
868
874
  withReasonPhrase(reasonPhrase: string): this;
@@ -870,7 +876,7 @@ declare class HttpRequestEventData implements IHttpRequestEventData {
870
876
  withBytesSent(bytesSent: number): this;
871
877
  withBytesReceived(bytesReceived: number): this;
872
878
  withTraceparentHeader(traceparentHeader: TraceparentHeader): this;
873
- addEventProperty(key: `event_properties.${string}`, value: EventProperty): this;
879
+ addEventProperty(key: EventPropertyKey, value: EventProperty): this;
874
880
  toJSON(): JSONObject | null;
875
881
  private hasValidMandatoryAttributes;
876
882
  private isInvalidUrl;
@@ -889,7 +895,7 @@ declare class HttpRequestEventData implements IHttpRequestEventData {
889
895
  * Events can include custom properties and duration information.
890
896
  * Use implementations of this interface with `Dynatrace.sendEvent()`.
891
897
  *
892
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
898
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-custom-events#send-custom-events
893
899
  */
894
900
  interface IEventData extends IBaseEvent {
895
901
  /**
@@ -959,7 +965,7 @@ declare class EventData implements IEventData {
959
965
  * user session and are attached to all subsequent events in that session.
960
966
  * Use implementations of this interface with `Dynatrace.sendSessionPropertyEvent()`.
961
967
  *
962
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
968
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-custom-events#send-session-property-events
963
969
  */
964
970
  interface ISessionPropertyEventData extends IBaseEvent {
965
971
  /**
@@ -1011,7 +1017,7 @@ declare class SessionPropertyEventData implements ISessionPropertyEventData {
1011
1017
  * to Dynatrace. Exception events can include custom properties.
1012
1018
  * Use implementations of this interface with `Dynatrace.sendExceptionEvent()`.
1013
1019
  *
1014
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
1020
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-error-crash-reporting#send-exception-event
1015
1021
  */
1016
1022
  interface IExceptionEventData extends IBaseEvent {
1017
1023
  /**
@@ -1100,7 +1106,7 @@ interface IDynatrace$1 {
1100
1106
  * });
1101
1107
  * ```
1102
1108
  *
1103
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
1109
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-custom-events#event-modifiers
1104
1110
  */
1105
1111
  addEventModifier(eventModifier: IEventModifier): IEventModifier;
1106
1112
  /**
@@ -1117,7 +1123,7 @@ interface IDynatrace$1 {
1117
1123
  * const removed = Dynatrace.removeEventModifier(modifier);
1118
1124
  * ```
1119
1125
  *
1120
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
1126
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-custom-events#remove-event-modifiers
1121
1127
  */
1122
1128
  removeEventModifier(eventModifier: IEventModifier): boolean;
1123
1129
  /**
@@ -1143,7 +1149,7 @@ interface IDynatrace$1 {
1143
1149
  * }
1144
1150
  * ```
1145
1151
  *
1146
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
1152
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-error-crash-reporting#send-exception-event
1147
1153
  */
1148
1154
  sendExceptionEvent(exceptionEventData: ExceptionEventData): void;
1149
1155
  /**
@@ -1164,7 +1170,7 @@ interface IDynatrace$1 {
1164
1170
  * Dynatrace.sendEvent(customEvent);
1165
1171
  * ```
1166
1172
  *
1167
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
1173
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-custom-events#send-custom-events
1168
1174
  */
1169
1175
  sendEvent(eventData: EventData): void;
1170
1176
  /**
@@ -1184,7 +1190,7 @@ interface IDynatrace$1 {
1184
1190
  * Dynatrace.startView('HomeScreen');
1185
1191
  * ```
1186
1192
  *
1187
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
1193
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-app-performance#view-monitoring
1188
1194
  */
1189
1195
  startView(name: string): void;
1190
1196
  /**
@@ -1208,7 +1214,7 @@ interface IDynatrace$1 {
1208
1214
  * Dynatrace.sendSessionPropertyEvent(sessionEvent);
1209
1215
  * ```
1210
1216
  *
1211
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
1217
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-custom-events#send-session-property-events
1212
1218
  */
1213
1219
  sendSessionPropertyEvent(sessionPropertyEventData: SessionPropertyEventData): void;
1214
1220
  /**
@@ -1231,7 +1237,7 @@ interface IDynatrace$1 {
1231
1237
  * Dynatrace.sendHttpRequestEvent(detailedRequest);
1232
1238
  * ```
1233
1239
  *
1234
- * @see https://docs.dynatrace.com/docs/observe/digital-experience/new-rum-experience/api
1240
+ * @see https://docs.dynatrace.com/docs/shortlink/react-native-web-request-performance#manual-http-request-reporting
1235
1241
  */
1236
1242
  sendHttpRequestEvent(httpRequestEvent: HttpRequestEventData): void;
1237
1243
  }
@@ -2080,8 +2086,16 @@ interface IDynatraceWebRequestTiming {
2080
2086
  */
2081
2087
  stopWebRequestTimingWithSize(responseCode: number, responseMessage: string, requestSize: number, responseSize: number): void;
2082
2088
  /**
2083
- * Returns the request tag value that should be used as the HTTP header value for tracking.
2089
+ * Generates a unique x-dynatrace header for the web request with a specified url,
2090
+ * which has to be manually added as http header.
2091
+ *
2084
2092
  * This is the same tag that was provided when constructing the DynatraceWebRequestTiming instance.
2093
+ * The header key can be obtained with the method getRequestTagHeader.
2094
+ *
2095
+ * The string value can be empty in cases when the agent is not able to send data, the agent is turned off completly,
2096
+ * has not started yet or is not allowed to track web requests because of privacy reasons.
2097
+ * The tag value is evaluated by the corresponding web server agent.
2098
+ * The Dynatrace server will link the server-side PurePath data with this mobile user action.
2085
2099
  *
2086
2100
  * @returns {string} The request tag value to be used as the HTTP header value
2087
2101
  *