@dynatrace/react-native-plugin 2.323.2 → 2.325.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 (33) hide show
  1. package/README.md +12 -7
  2. package/android/build.gradle +1 -1
  3. package/files/plugin.gradle +1 -1
  4. package/index.js +18 -11
  5. package/instrumentation/jsx/CreateElement.js +10 -7
  6. package/instrumentation/model/Types.js +0 -1
  7. package/internal.js +7 -0
  8. package/lib/core/DynatraceAction.js +3 -2
  9. package/lib/core/DynatraceWebRequestTiming.js +5 -5
  10. package/lib/core/NullWebRequestTiming.js +1 -0
  11. package/lib/core/configuration/Configuration.js +2 -2
  12. package/lib/core/configuration/ConfigurationBuilder.js +3 -2
  13. package/lib/core/configuration/ManualStartupConfiguration.js +6 -3
  14. package/lib/core/interface/IWebRequestTiming.js +1 -0
  15. package/lib/core/logging/LogLevel.js +1 -10
  16. package/lib/core/logging/LogLevelUtil.js +13 -0
  17. package/lib/next/Dynatrace.js +22 -15
  18. package/lib/next/appstart/AppStartObserver.js +1 -1
  19. package/lib/next/events/EventPipeline.js +14 -6
  20. package/lib/next/events/IHttpRequestEventBuilder.js +2 -0
  21. package/lib/next/events/modifier/BaseDataEventModifier.js +6 -0
  22. package/lib/next/events/modifier/EventModifierUtil.js +21 -1
  23. package/lib/next/events/modifier/ModifyEventValidation.js +18 -5
  24. package/lib/next/events/spec/EventSpecContstants.js +1 -0
  25. package/package.json +12 -6
  26. package/public.js +22 -0
  27. package/react-augmentation.js +3 -0
  28. package/react-native-dynatrace.podspec +1 -1
  29. package/scripts/core/LineOffsetAnalyzeCall.js +3 -3
  30. package/types.d.ts +1969 -0
  31. package/instrumentation/model/TypesUtil.js +0 -21
  32. package/src/instrumentation/jsx/IDynatraceProperties.ts +0 -15
  33. package/typings/react-native-dynatrace.d.ts +0 -1849
@@ -1,1849 +0,0 @@
1
- import 'react'
2
- import { IDynatraceProperties } from '../src/instrumentation/jsx/IDynatraceProperties';
3
-
4
- /**
5
- * react-native-dynatrace.d.ts
6
- *
7
- * Type definition file for the react native dynatrace package
8
- */
9
-
10
- /**
11
- * Specifying a platform when you want individual behaviour and
12
- * commands will only be sent to a certain platform.
13
- */
14
- export declare enum Platform {
15
- /**
16
- * If set, the command will only be sent to the Android platform.
17
- *
18
- * Usage:
19
- *
20
- * ```ts
21
- * import { Dynatrace, Platform } from '@dynatrace/react-native-plugin';
22
- *
23
- * let myAction = Dynatrace.enterAutoAction("MyButton tapped", Platform.Android);
24
- * //Perform the action and whatever else is needed.
25
- * myAction.leaveAction();
26
- * ```
27
- */
28
- Android,
29
-
30
- /**
31
- * If set, the command will only be sent to the iOS platform.
32
- *
33
- * Usage:
34
- *
35
- * ```ts
36
- * import { Dynatrace, Platform } from '@dynatrace/react-native-plugin';
37
- *
38
- * let myAction = Dynatrace.enterAutoAction("MyButton tapped", Platform.Ios);
39
- * //Perform the action and whatever else is needed.
40
- * myAction.leaveAction();
41
- * ```
42
- */
43
- Ios
44
- }
45
-
46
- /**
47
- * Level of log message that will be printed
48
- */
49
- export declare enum LogLevel {
50
- /**
51
- * With debug log level, a lot of diagnostic infos will be printed by the plugin.
52
- *
53
- * Usage:
54
- *
55
- * - via `dynatrace.config.js` by setting `react.debug` to `true`
56
- * - via code and manual startup by using the `ConfigurationBuilder`:
57
- *
58
- * ```ts
59
- * import { ConfigurationBuilder, Dynatrace, LogLevel } from '@dynatrace/react-native-plugin';
60
- *
61
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
62
- * await Dynatrace.start(configurationBuilder.withLogLevel(LogLevel.Debug).buildConfiguration());
63
- * ```
64
- */
65
- Debug,
66
-
67
- /**
68
- * With info log level, only the necessary infos will be printed by the plugin.
69
- *
70
- * Usage:
71
- *
72
- * By default `LogLevel.Info` is used, so usually setting this property is not needed.
73
- *
74
- * - via `dynatrace.config.js` by setting `react.debug` to `false`
75
- * - via code and manual startup by using the `ConfigurationBuilder`:
76
- *
77
- * ```ts
78
- * import { ConfigurationBuilder, Dynatrace, LogLevel } from '@dynatrace/react-native-plugin';
79
- *
80
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
81
- * await Dynatrace.start(configurationBuilder.withLogLevel(LogLevel.Info).buildConfiguration());
82
- * ```
83
- */
84
- Info
85
- }
86
-
87
- /**
88
- * Enum that represents the different privacy levels. Every level decides about the amount of data,
89
- * which is actually collected and sent by the agent.
90
- *
91
- * Usage:
92
- *
93
- * Using `DataCollectionLevel` is only possible when `UserOptIn` was enabled.
94
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-opt-in-mode
95
- *
96
- * General information:
97
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
98
- * @see https://docs.dynatrace.com/docs/platform-modules/digital-experience/mobile-applications/additional-configuration/configure-rum-privacy-mobile#data-collection-levels
99
- */
100
- export declare enum DataCollectionLevel {
101
- /**
102
- * Monitoring data is not sent.
103
- * - No personal data is sent; all identifiers are randomized on every launch.
104
- * - A single Loading <App> event is sent to track the number of users that opted out.
105
- *
106
- * Usage:
107
- *
108
- * ```ts
109
- * import { DataCollectionLevel, Dynatrace, UserPrivacyOptions } from '@dynatrace/react-native-plugin';
110
- *
111
- * const privacyConfig = new UserPrivacyOptions(DataCollectionLevel.Off, false);
112
- * Dynatrace.applyUserPrivacyOptions(privacyConfig);
113
- * ```
114
- *
115
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
116
- * @see https://docs.dynatrace.com/docs/platform-modules/digital-experience/mobile-applications/additional-configuration/configure-rum-privacy-mobile#data-collection-levels
117
- */
118
- Off,
119
-
120
- /**
121
- * Only performance, automatically captured data is sent.
122
- * - No personal data is sent; all identifiers are randomized on every launch.
123
- *
124
- * Usage:
125
- *
126
- * ```ts
127
- * import { DataCollectionLevel, Dynatrace, UserPrivacyOptions } from '@dynatrace/react-native-plugin';
128
- *
129
- * const privacyConfig = new UserPrivacyOptions(DataCollectionLevel.Performance, true);
130
- * Dynatrace.applyUserPrivacyOptions(privacyConfig);
131
- * ```
132
- *
133
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
134
- * @see https://docs.dynatrace.com/docs/platform-modules/digital-experience/mobile-applications/additional-configuration/configure-rum-privacy-mobile#data-collection-levels
135
- */
136
- Performance,
137
-
138
- /**
139
- * @deprecated Replaced by `DataCollectionLevel.UserBehavior`
140
- */
141
- User,
142
-
143
- /**
144
- * Performance data and user data is sent.
145
- * - Personal data is sent; OneAgent recognizes and reports users who revisit in the future.
146
- * - If you haven't configured user tagging and custom event or value reporting, the User behavior level works similarly to the Performance level.
147
- *
148
- * Usage:
149
- *
150
- * ```ts
151
- * import { DataCollectionLevel, Dynatrace, UserPrivacyOptions } from '@dynatrace/react-native-plugin';
152
- *
153
- * const privacyConfig = new UserPrivacyOptions(DataCollectionLevel.UserBehavior, true);
154
- * Dynatrace.applyUserPrivacyOptions(privacyConfig);
155
- * ```
156
- *
157
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
158
- * @see https://docs.dynatrace.com/docs/platform-modules/digital-experience/mobile-applications/additional-configuration/configure-rum-privacy-mobile#data-collection-levels
159
- */
160
- UserBehavior,
161
- }
162
-
163
- type Primitive = string | number | boolean;
164
- type JSONArray = JSONValue[];
165
- type JSONValue = Primitive | JSONArray | JSONObject;
166
-
167
- /**
168
- * JSON Object which can be used for sendEvent API
169
- */
170
- export declare interface JSONObject {
171
- [key: string]: JSONValue;
172
- }
173
-
174
- export declare const Dynatrace: {
175
- /**
176
- * Starting the React Native plugin and OneAgent for Android or iOS. This method is only necessary
177
- * in case of manual startup and should be ignored in auto startup scenarios. The start method will
178
- * set the error handler for reporting crashes and will apply the provided configuration globally.
179
- *
180
- * @param {IConfiguration} configuration Configuration for a manual startup of the plugin
181
- *
182
- * Usage:
183
- *
184
- * ```ts
185
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
186
- *
187
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
188
- * // Use several configuration options like withLogLevel(LogLevel.Debug)
189
- * await Dynatrace.start(configurationBuilder.buildConfiguration());
190
- * ```
191
- *
192
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
193
- */
194
- start(configuration: IConfiguration): Promise<void>;
195
-
196
- /**
197
- * This call allows to monitor the passed in component. Depending on the type of the component
198
- * (Function Component or Class Component), it will be wrapped and data of renderings will be
199
- * automatically reported.
200
- *
201
- * The name of the Component, which can be passed as parameter, is important because the build
202
- * process will remove the name of a Functional Component. Still this parameter is optional as
203
- * other properties can be used at runtime as well (e.g. dtActionName).
204
- *
205
- * @param Component Functional or Class Component
206
- * @param {string} name The name of the Component
207
- * @returns The Component which was wrapped to be monitored
208
- *
209
- * Usage:
210
- *
211
- * ```ts
212
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
213
- *
214
- * export function MyFunctionalComponent(){
215
- * // Content of component
216
- * }
217
- *
218
- * Dynatrace.withMonitoring(MyFunctionalComponent, "MyFunctionalComponent");
219
- * ```
220
- *
221
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#monitor-a-component
222
- */
223
- withMonitoring(Component: React.FunctionComponent<any> | React.ComponentClass<any>, name?: string): React.FunctionComponent<any> | React.ComponentClass<any>
224
-
225
- /**
226
- * Reroutes to `Dynatrace.enterAutoAction`
227
- *
228
- * @deprecated Please use either {@link enterAutoAction}, which is doing the same or alternatively {@link enterManualAction}.
229
- */
230
- enterAction(name: string, platform?: Platform): IDynatraceAction;
231
-
232
- /**
233
- * Creates an Action which will NOT be handled by the plugin. This means that you have full control
234
- * about the hierachy of your actions. This function will create a {@link IDynatraceRootAction} for you,
235
- * which has the ability to create child actions via {@link IDynatraceRootAction.enterAction}. Be aware,
236
- * because of the full manual approach the plugin will not link webrequest automatically. Webrequest
237
- * have to be manually tagged by using the tag provided by the action via {@link IDynatraceAction.getRequestTag}.
238
- *
239
- * @param {string} name Name of the action, which will be created. This name must not be empty.
240
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
241
- * @returns {IDynatraceRootAction} Action that is created. If name was empty a NullRootAction will be provided,
242
- * which will act as normal root action, but has no functionality.
243
- *
244
- * Usage:
245
- *
246
- * ```ts
247
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
248
- *
249
- * let myAction = Dynatrace.enterManualAction("MyButton tapped");
250
- * // Perform the action and whatever else is needed.
251
- * myAction.leaveAction();
252
- * ```
253
- *
254
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#create-custom-actions
255
- */
256
- enterManualAction(name: string, platform?: Platform): IDynatraceRootAction;
257
-
258
- /**
259
- * Creates an Action which will be automatically handled by the plugin. This means that the
260
- * plugin decides about the hierachy of this action. If there is no open action, the following
261
- * action will be a root action. All other actions created by this method, while a root action
262
- * is open, will be automatically inserted as a child action. Furthermore the plugin will automatically
263
- * link webrequest (if they are not tagged manually) to the open root action.
264
- *
265
- * @param {string} name Name of the action, which will be created. This name must not be empty.
266
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
267
- * @returns {IDynatraceAction} Action that is created. If name was empty a NullAction will be provided,
268
- * which will act as normal action, but has no functionality.
269
- *
270
- * Usage:
271
- *
272
- * ```ts
273
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
274
- *
275
- * let myAction = Dynatrace.enterAutoAction("MyButton tapped");
276
- * // Perform the action and whatever else is needed.
277
- * myAction.leaveAction();
278
- * ```
279
- *
280
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#create-custom-actions
281
- */
282
- enterAutoAction(name: string, platform?: Platform): IDynatraceAction;
283
-
284
- /**
285
- * Can be called to end the current visit and start a new visit. All current actions are
286
- * closed and sent to the server.
287
- *
288
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
289
- *
290
- * Usage:
291
- *
292
- * ```ts
293
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
294
- *
295
- * Dynatrace.endSession();
296
- * ```
297
- *
298
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#end-the-current-user-session
299
- */
300
- endSession(platform?: Platform): void;
301
-
302
- /**
303
- * The current visit/session will be tagged with the provided user id.
304
- * The value will not be stored and has to be renewed for every new session.
305
- *
306
- * @param {string} user a unique id that allows you to identify the current user.
307
- * If user is null or empty, then the user tag will be removed from the session.
308
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
309
- *
310
- * Usage:
311
- *
312
- * ```ts
313
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
314
- *
315
- * Dynatrace.identifyUser('User');
316
- * ```
317
- *
318
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#identify-a-user
319
- */
320
- identifyUser(user: string, platform?: Platform): void;
321
-
322
- /**
323
- * Saves the given GPS location for reporting along with the captured data.
324
- *
325
- * @param {Number} latitude latitude data of the position
326
- * @param {Number} longitude longitude data of the position
327
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
328
- *
329
- * Usage:
330
- *
331
- * ```ts
332
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
333
- *
334
- * Dynatrace.setGPSLocation(48.31518732698596, 14.305245274594471);
335
- * ```
336
- *
337
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#report-gps-location
338
- */
339
- setGPSLocation(latitude: Number, longitude: Number, platform?: Platform): void;
340
-
341
- /**
342
- * Call this function to flush all collected events immediately. To reduce network chatter, the collected events are usually
343
- * sent in packages where the oldest event has an age of up to 2 minutes (the default; the maximum age can be configured).
344
- * Using this function, you can force sending of all collected events regardless of their age.
345
- *
346
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
347
- *
348
- * Usage:
349
- *
350
- * ```ts
351
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
352
- *
353
- * Dynatrace.flushEvents();
354
- * ```
355
- *
356
- */
357
- flushEvents(platform?: Platform): void;
358
-
359
- /**
360
- * Tells you if you opted into crash reporting. If this value is false, which means off,
361
- * the native agent will not report a single crash that is happening within the application.
362
- * This method will always return true, when the user optin feature is not used.
363
- *
364
- * @deprecated Please use {@link getUserPrivacyOptions} to get the crash reporting opt-in value.
365
- *
366
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
367
- * @returns {Promise<boolean>} Promise which resolves true if crash reporting is opted in.
368
- */
369
- isCrashReportingOptedIn(platform?: Platform): Promise<boolean>;
370
-
371
- /**
372
- * Allows the user to activate/deactivate crash reporting and stores the users decisions for future sessions.
373
- * This method can only be used, when the configuration (dynatrace.config.js) for android or iOS is using the userOptIn mode.
374
- *
375
- * @deprecated Please use {@link applyUserPrivacyOptions} to set crash reporting opt-in.
376
- *
377
- * @param {boolean} crashReporting Pass true, if you want to enable crash reporting
378
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
379
- */
380
- setCrashReportingOptedIn(crashReporting: boolean, platform?: Platform): void;
381
-
382
- /**
383
- * Returns the current {@link DataCollectionLevel} which is used by the plugin. This method will always
384
- * return {@link DataCollectionLevel.UserBehavior}, when the user opt-in feature is not used.
385
- *
386
- * @deprecated Please use {@link getUserPrivacyOptions} to get the current data collection level value.
387
- *
388
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
389
- * @returns promise which resolve a data collection level string
390
- */
391
- getDataCollectionLevel(platform?: Platform): Promise<DataCollectionLevel>;
392
-
393
- /**
394
- * Allows the user to set the {@link DataCollectionLevel} and stores the users decisions for future sessions.
395
- * This method can only be used, when the configuration (dynatrace.config.js) for android or iOS is using the userOptIn mode.
396
- * When the user changes the {@link DataCollectionLevel} a new session will be started.
397
- *
398
- * @deprecated Please use {@link applyUserPrivacyOptions} to apply the current data collection level value.
399
- *
400
- * @param {DataCollectionLevel} dataCollectionLevel New data collection level
401
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
402
- */
403
- setDataCollectionLevel(dataCollectionLevel: DataCollectionLevel, platform?: Platform): void;
404
-
405
- /**
406
- * Get the current user privacy options including data collection level (Off, Performance, UserBehavior)
407
- * and if crash reporting opt-in is enabled
408
- *
409
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
410
- * @returns {Promise<UserPrivacyOptions>} current user privacy options
411
- *
412
- * Usage:
413
- *
414
- * ```ts
415
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
416
- *
417
- * let privacyOptions = await Dynatrace.getUserPrivacyOptions();
418
- * ```
419
- *
420
- */
421
- getUserPrivacyOptions(platform?: Platform): Promise<UserPrivacyOptions>;
422
-
423
- /**
424
- * Creates a new session with the specified privacy settings and stores the privacy settings for future sessions.
425
- * This method can only be used, when user opt-in feature is enabled. This method call has no effect,
426
- * if the given privacy settings are identical to the previously specified privacy settings.
427
- *
428
- * @param {UserPrivacyOptions} userPrivacyOptions the new privacy settings from the user
429
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
430
- *
431
- * Usage:
432
- *
433
- * ```ts
434
- * import { DataCollectionLevel, Dynatrace, UserPrivacyOptions } from '@dynatrace/react-native-plugin';
435
- *
436
- * Dynatrace.applyUserPrivacyOptions(new UserPrivacyOptions(DataCollectionLevel.Performance, true));
437
- * ```
438
- *
439
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
440
- */
441
- applyUserPrivacyOptions(userPrivacyOptions: UserPrivacyOptions, platform?: Platform): void;
442
-
443
- /**
444
- * Similar to {@link IDynatraceAction.reportError}. But the error event is reported as root action.
445
- *
446
- * @param {string} errorName Name of the error event
447
- * @param {number} errorCode The code of the error
448
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
449
- *
450
- * Usage:
451
- *
452
- * ```ts
453
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
454
- *
455
- * Dynatrace.reportError("Page not found", 404);
456
- * ```
457
- *
458
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#report-values
459
- */
460
- reportError(errorName: string, errorCode: number, platform?: Platform): void;
461
-
462
- /**
463
- * Reports a stacktrace
464
- *
465
- * @deprecated Please use {@link reportErrorStacktrace} instead.
466
- *
467
- * @param {string} errorName Name of the Error - SyntaxError
468
- * @param {string} reason Reason for the Error
469
- * @param {string} stacktrace Whole Stacktrace
470
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
471
- */
472
- reportErrorWithStacktrace(errorName: string, reason: string, stacktrace: string, platform?: Platform): void;
473
-
474
- /**
475
- * Reports a stacktrace
476
- *
477
- * @param {string} errorName Name of the error
478
- * @param {string} errorValue Value of the error
479
- * @param {string} reason Reason for the error
480
- * @param {string} stacktrace Whole stacktrace
481
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
482
- *
483
- * Usage:
484
- *
485
- * ```ts
486
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
487
- *
488
- * Dynatrace.reportErrorStacktrace("Error Name", "Error Value", "Reason", "Stacktrace");
489
- * ```
490
- *
491
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#report-an-error-stacktrace
492
- */
493
- reportErrorStacktrace(errorName: string, errorValue: string, reason: string, stacktrace: string, platform?: Platform): void;
494
-
495
- /**
496
- * Reports a custom crash
497
- *
498
- * @param {string} crashName Name of the crash
499
- * @param {string} reason Reason for the crash
500
- * @param {string} stacktrace Whole stacktrace
501
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
502
- *
503
- * Usage:
504
- *
505
- * ```ts
506
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
507
- *
508
- * Dynatrace.reportCrash("Crash Name", "Reason", "Stacktrace");
509
- * ```
510
- *
511
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manually-report-a-crash
512
- */
513
- reportCrash(crashName: string, reason: string, stacktrace: string, platform?: Platform): void;
514
-
515
- /**
516
- * Reports a crash with an error object (which needs to contain a stacktrace)
517
- *
518
- * @param {string} crashName Name of the crash
519
- * @param {Error} crash error object
520
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
521
- *
522
- * Usage:
523
- *
524
- * ```ts
525
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
526
- *
527
- * Dynatrace.reportCrashWithException("Crash Name", error);
528
- * ```
529
- *
530
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manually-report-a-crash
531
- */
532
- reportCrashWithException(crashName: string, crash: Error, platform?: Platform): void;
533
-
534
- /**
535
- * Puts a set of http headers on every agent http request (eg. the Authorization header). It also triggers the agent to
536
- * reconnect to the beacon endpoint with the new headers. To clear the previous headers,
537
- * call the method with a null or empty value.
538
- *
539
- * @param {Map<string, string>} headers a set of http headers
540
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
541
- *
542
- * Usage:
543
- *
544
- * ```ts
545
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
546
- *
547
- * const beaconHeaders = new Map<string, string>();
548
- * beaconHeaders.set('headerName', 'headerValue');
549
- * Dynatrace.setBeaconHeaders(beaconHeaders);
550
- * ```
551
- *
552
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#setting-beacon-headers
553
- */
554
- setBeaconHeaders(headers?: Map<string, string> | null, platform?: Platform): void;
555
-
556
- /**
557
- * Send a Business Event
558
- *
559
- * With sendBizEvent, you can report a business event. These standalone events are being sent
560
- * detached from user actions or sessions.
561
- *
562
- * Note: The 'dt' key, as well as all 'dt.' prefixed keys are considered reserved by Dynatrace
563
- * and will be stripped from the passed in attributes.
564
- *
565
- * Note: Business events are only supported on Dynatrace SaaS deployments currently.
566
- *
567
- * @param {string} type Mandatory event type
568
- * @param {JSONObject} attributes Must be a valid JSON object and cannot contain functions,
569
- * undefined, Infinity and NaN as values, otherwise they will be removed.
570
- * Attributes need to be serializable using JSON.stringify.
571
- * The resulting event will be populated with attributes parameter,
572
- * and enriched with additional properties, thus also empty objects are valid.
573
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
574
- *
575
- * Usage:
576
- *
577
- * ```ts
578
- * import { Dynatrace, JSONObject } from '@dynatrace/react-native-plugin';
579
- *
580
- * Dynatrace.sendBizEvent('type', { custom : 123 });
581
- * ```
582
- *
583
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#business-event-capturing
584
- */
585
- sendBizEvent(type: string, attributes?: JSONObject, platform?: Platform): void;
586
-
587
- /**
588
- * Adds an event modifier, which will be executed in the end before
589
- * the event is transfered. This allows to modify the event to some extent.
590
- *
591
- * @param eventModifier Function which is modify an event
592
- */
593
- addEventModifier(eventModifier: IEventModifier): IEventModifier;
594
-
595
- /**
596
- * Is removing an event modifier again, so it will not modify events anymore.
597
- *
598
- * @param eventModifier Function which should be removed
599
- */
600
- removeEventModifier(eventModifier: IEventModifier): boolean;
601
-
602
- /**
603
- * Send a Event
604
- *
605
- * With sendEvent, you can report a event.
606
- *
607
- * Note: The 'dt' key, as well as all 'dt.' prefixed keys are considered reserved by Dynatrace
608
- * and will be stripped from the passed in attributes. TODO: Add Others here.
609
- *
610
- * @param {string} type Mandatory event type
611
- * @param {JSONObject} properties Must be a valid JSON object and cannot contain functions,
612
- * undefined, Infinity and NaN as values, otherwise they will be removed.
613
- * Attributes need to be serializable using JSON.stringify.
614
- * The resulting event will be populated with attributes parameter,
615
- * and enriched with additional properties, thus also empty objects are valid.
616
- * @param {any} context optional context that can be used to manipulate the resulting event
617
- * using an event modifier
618
- */
619
- sendEvent(properties: JSONObject, context?: any): void;
620
-
621
- /**
622
- * Sets the current view context which will be used for every event happening in the meantime.
623
- *
624
- * @param name Name of the current view
625
- */
626
- startView(name: string): void;
627
-
628
- /**
629
- * Removes the current view context
630
- */
631
- stopView(): void;
632
-
633
- /**
634
- * Send a Session Properties Event.
635
- *
636
- * With sendSessionPropertyEvent you can report properties that apply to all events in the current session. Any
637
- * custom properties must be added in the 'session_properties.*' namespace, otherwise they will be dropped. Only one
638
- * session properties event may be active for every session.
639
- *
640
- * @param properties any attributes that should be reported for every event in the session.
641
- */
642
- sendSessionPropertyEvent(properties: JSONObject): void;
643
-
644
- /**
645
- *
646
- * Send an HttpRequestEvent by passing in an instance of HttpRequestEventBuilder.
647
- * The Builder allows you to configure common properties of an HttpRequest like url, requestMethod and duration.
648
- * Additionally, it allows you to set custom event properties.
649
- *
650
- * @param httpRequestEventBuilder Mandatory Builder which allows you to configure common properties of an HttpRequest
651
- *
652
- * Usage:
653
- *
654
- * ```ts
655
- * import { Dynatrace, HttpRequestEventBuilder } from '@dynatrace/react-native-plugin';
656
- *
657
- * Dynatrace.sendHttpRequestEvent(
658
- * new HttpRequestEventBuilder("http://www.dynatrace.com", "POST")
659
- * .withDuration(100)
660
- * .withStatusCode(404)
661
- * .withReasonPhrase("HTTP/1.1 404 Not Found")
662
- * .withError(new Error())
663
- * .withBytesSent(100)
664
- * .withBytesReceived(100)
665
- * .withTraceparentHeader("traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01")
666
- * .addEventProperty("event_properties.userid", 12345)
667
- * .addEventProperty("event_properties.response", "example body")
668
- * );
669
- * ```
670
- */
671
- sendHttpRequestEvent(httpRequestEventBuilder: HttpRequestEventBuilder): void
672
- }
673
-
674
- /**
675
- * Interface which declares event modification through modifyEvent
676
- */
677
- export declare interface IEventModifier {
678
- /**
679
- * Event as JSONObject is received and can be modified. If instead of the event
680
- * null is returned, the event will be canceled.
681
- *
682
- * @param event Event as JSONObject
683
- * @param context optional context that can be used to manipulate the resulting event
684
- * using an event modifier or undefined if not available
685
- * @returns Either the modified event or null if you want to cancel the event
686
- */
687
- modifyEvent(event: JSONObject | null, context?: any): JSONObject | null;
688
- }
689
-
690
- export declare interface IDynatraceAction {
691
- /**
692
- * Reports an error as key-value pair with the time at which it occurred.
693
- * This event can be used to report error codes.
694
- *
695
- * @param {string} errorName Name of the error event
696
- * @param {number} errorCode The code of the error
697
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
698
- *
699
- * Usage:
700
- *
701
- * ```ts
702
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
703
- *
704
- * const action = Dynatrace.enterAutoAction("Action Name");
705
- * action.reportError("Page Not Found", 404);
706
- * action.leaveAction();
707
- * ```
708
- *
709
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#report-values
710
- */
711
- reportError(errorName: string, errorCode: number, platform?: Platform): void;
712
-
713
- /**
714
- * Reports the time when a specific event occurred. This event can be used to determine when a user passed
715
- * through a specific part of your application. The reportEvent method is a simple way to track user
716
- * behavior in your application.
717
- *
718
- * @param eventName Name of the event
719
- * @param platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
720
- *
721
- * Usage:
722
- *
723
- * ```ts
724
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
725
- *
726
- * const action = Dynatrace.enterAutoAction("Action Name");
727
- * action.reportEvent("Event Name");
728
- * action.leaveAction();
729
- * ```
730
- *
731
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#report-values
732
- */
733
- reportEvent(eventName: string, platform?: Platform): void;
734
-
735
- /**
736
- * Reports a key-value pair with the time at which this event occurred. This event can be used to report
737
- * important measurement data.
738
- *
739
- * @param {string} valueName Name of the value
740
- * @param {string} value The string value
741
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
742
- *
743
- * Usage:
744
- *
745
- * ```ts
746
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
747
- *
748
- * const action = Dynatrace.enterAutoAction("Action Name");
749
- * action.reportStringValue("Value Name", "Value");
750
- * action.leaveAction();
751
- * ```
752
- *
753
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#report-values
754
- */
755
- reportStringValue(valueName: string, value: string, platform?: Platform): void;
756
-
757
- /**
758
- * Reports a key-value pair with the time at which this event occurred. This event can be used to report
759
- * important measurement data.
760
- *
761
- * @param valueName Name of the value
762
- * @param value Integer value
763
- * @param platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
764
- *
765
- * Usage:
766
- *
767
- * ```ts
768
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
769
- *
770
- * const action = Dynatrace.enterAutoAction("Action Name");
771
- * action.reportIntValue("Value Name", 123);
772
- * action.leaveAction();
773
- * ```
774
- *
775
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#report-values
776
- */
777
- reportIntValue(valueName: string, value: number, platform?: Platform): void;
778
-
779
- /**
780
- * Reports a key-value pair with the time at which this event occurred. This event can be used to report
781
- * important measurement data.
782
- *
783
- * @param valueName Name of the value
784
- * @param value Double value
785
- * @param platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
786
- *
787
- * Usage:
788
- *
789
- * ```ts
790
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
791
- *
792
- * const action = Dynatrace.enterAutoAction("Action Name");
793
- * action.reportDoubleValue("Value Name", 123.123);
794
- * action.leaveAction();
795
- * ```
796
- *
797
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#report-values
798
- */
799
- reportDoubleValue(valueName: string, value: number, platform?: Platform): void;
800
-
801
- /**
802
- * Completes this action and prepares the data for the next sending interval.
803
- * When an outer/parent action is exited, all nested/child actions are automatically closed.
804
- *
805
- * @param platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
806
- *
807
- * Usage:
808
- *
809
- * ```ts
810
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
811
- *
812
- * const action = Dynatrace.enterAutoAction("Action Name");
813
- * action.leaveAction();
814
- * ```
815
- *
816
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#create-custom-actions
817
- */
818
- leaveAction(platform?: Platform): void;
819
-
820
- /**
821
- * Cancels this action and discards all associated data
822
- *
823
- * @param platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
824
- *
825
- * Usage:
826
- *
827
- * ```ts
828
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
829
- *
830
- * const action = Dynatrace.enterAutoAction("Action Name");
831
- * action.cancelAction();
832
- * ```
833
- *
834
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#cancel-actions
835
- */
836
- cancel(platform?: Platform): void;
837
-
838
- /**
839
- * Retrieve the request tag for this certain root action. This will
840
- * allow you to manually link a web request to this action if you use
841
- * this tag as header value.
842
- *
843
- * @param {string} url URL that you want to track
844
- * @returns {Promise<string>} header tag which should be applied onto the request
845
- *
846
- * Usage:
847
- *
848
- * ```ts
849
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
850
- *
851
- * const action = Dynatrace.enterAutoAction("Action Name");
852
- * const requestTag = await action.getRequestTag("http://dynatrace.com");
853
- * // Attach requestTag as x-dynatrace header to a request
854
- *
855
- * action.leaveAction();
856
- * ```
857
- *
858
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
859
- */
860
- getRequestTag(url: string): Promise<string>;
861
-
862
- /**
863
- * If you want to manually link a web request with an action this is
864
- * the name of the header you need to set.
865
- *
866
- * @returns {string} name of the header that should be used for tagging a request
867
- *
868
- * Usage:
869
- *
870
- * ```ts
871
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
872
- *
873
- * const action = Dynatrace.enterAutoAction("Action Name");
874
- * const requestTagHeader = await action.getRequestTagHeader();
875
- * // Use requestTagHeader as header name
876
- *
877
- * action.leaveAction();
878
- * ```
879
- *
880
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
881
- */
882
- getRequestTagHeader(): string;
883
- }
884
-
885
- /**
886
- * Root action which can additionally to the normal IDynatraceAction
887
- * create another layer of actions underneath.
888
- */
889
- export declare interface IDynatraceRootAction extends IDynatraceAction {
890
- /**
891
- * Create a child action
892
- *
893
- * @param {string} actionName - name of action
894
- * @param {Platform} platform Is optional, which means by default this call will be applied on both platforms (Android & iOS).
895
- * @return {IDynatraceAction} created action
896
- *
897
- * Usage:
898
- *
899
- * ```ts
900
- * import { Dynatrace } from '@dynatrace/react-native-plugin';
901
- *
902
- * const parentAction = Dynatrace.enterManualAction("Parent Action Name");
903
- * const childAction = parentAction.enterAction("Child Action Name");
904
- * // Do something with actions
905
- *
906
- * childAction.leaveAction();
907
- * parentAction.leaveAction();
908
- * ```
909
- *
910
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#create-custom-sub-actions
911
- */
912
- enterAction(name: string, platform?: Platform): IDynatraceAction;
913
- }
914
-
915
- /**
916
- * The Web request timing interface which can be used to measure a web request manually
917
- */
918
- export declare interface IDynatraceWebRequestTiming {
919
- /**
920
- * Start the measurment of the web request. Call this before the request is started.
921
- *
922
- * Usage (with Axios example):
923
- *
924
- * ```ts
925
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
926
- *
927
- * const action = Dynatrace.enterManualAction("Manual Web Request");
928
- * const tag = await action.getRequestTag(url);
929
- * const timing = new DynatraceWebRequestTiming(url, tag);
930
- *
931
- * try {
932
- * timing.startWebRequestTiming();
933
- * const axiosResponse = await axios.get(url, {
934
- * headers: {
935
- * timing.getRequestTagHeader(): tag
936
- * }
937
- * });
938
- * timing.stopWebRequestTiming(axiosResponse.status, axiosResponse.data);
939
- * } catch (error) {
940
- * timing.stopWebRequestTiming(-1, error);
941
- * } finally {
942
- * action.leaveAction();
943
- * }
944
- * ```
945
- *
946
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
947
- */
948
- startWebRequestTiming(): void;
949
-
950
- /**
951
- * Stops the measurment of the web request. This needs to be called after the request is executed.
952
- * The responseCode and responseMessage will be transfered and shown in the web UI.
953
- *
954
- * @param {number} responseCode Status Code of the response e.g. 200
955
- * @param {string} responseMessage Message of the response
956
- *
957
- * Usage (with Axios example):
958
- *
959
- * ```ts
960
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
961
- *
962
- * const action = Dynatrace.enterManualAction("Manual Web Request");
963
- * const tag = await action.getRequestTag(url);
964
- * const timing = new DynatraceWebRequestTiming(url, tag);
965
- *
966
- * try {
967
- * timing.startWebRequestTiming();
968
- * const axiosResponse = await axios.get(url, {
969
- * headers: {
970
- * timing.getRequestTagHeader(): tag
971
- * }
972
- * });
973
- * timing.stopWebRequestTiming(axiosResponse.status, axiosResponse.data);
974
- * } catch (error) {
975
- * timing.stopWebRequestTiming(-1, error);
976
- * } finally {
977
- * action.leaveAction();
978
- * }
979
- * ```
980
- *
981
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
982
- */
983
- stopWebRequestTiming(responseCode: number, responseMessage: string): void;
984
-
985
- /**
986
- * Stops the measurment of the web request. This needs to be called after the request is executed.
987
- * The responseCode and responseMessage will be transfered and shown in the web UI.
988
- *
989
- * @param {number} responseCode Status Code of the response e.g. 200
990
- * @param {string} responseMessage Message of the response
991
- * @param requestSize Request size
992
- * @param responseSize Response size
993
- *
994
- * Usage (with Axios example):
995
- *
996
- * ```ts
997
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
998
- *
999
- * const action = Dynatrace.enterManualAction("Manual Web Request");
1000
- * const tag = await action.getRequestTag(url);
1001
- * const timing = new DynatraceWebRequestTiming(url, tag);
1002
- *
1003
- * try {
1004
- * timing.startWebRequestTiming();
1005
- * const axiosResponse = await axios.get(url, {
1006
- * headers: {
1007
- * timing.getRequestTagHeader(): tag
1008
- * }
1009
- * });
1010
- * timing.stopWebRequestTimingWithSize(axiosResponse.status, axiosResponse.data, 122, 63);
1011
- * } catch (error) {
1012
- * timing.stopWebRequestTiming(-1, error);
1013
- * } finally {
1014
- * action.leaveAction();
1015
- * }
1016
- * ```
1017
- *
1018
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
1019
- */
1020
- stopWebRequestTimingWithSize(responseCode: number, responseMessage: string, requestSize: number, responseSize: number): void;
1021
-
1022
- /**
1023
- * Returns the content for the header that is needed in order to track a request
1024
- *
1025
- * @returns {string} header tag which should be applied onto the request
1026
- *
1027
- * Usage:
1028
- *
1029
- * ```ts
1030
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
1031
- *
1032
- * const action = Dynatrace.enterManualAction("Manual Web Request");
1033
- * const tag = await action.getRequestTag(url);
1034
- * const timing = new DynatraceWebRequestTiming(url, tag);
1035
- *
1036
- * // Printing the same tag which was used as input for DynatraceWebRequestTiming
1037
- * console.log(timing.getRequestTag());
1038
- * ```
1039
- *
1040
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
1041
- */
1042
- getRequestTag(): string;
1043
-
1044
- /**
1045
- * Returns the name for the header that is needed in order to track a request
1046
- *
1047
- * @returns {string} name of the header that should be used for tagging a request
1048
- *
1049
- * Usage:
1050
- *
1051
- * ```ts
1052
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
1053
- *
1054
- * const action = Dynatrace.enterManualAction("Manual Web Request");
1055
- * const tag = await action.getRequestTag(url);
1056
- * const timing = new DynatraceWebRequestTiming(url, tag);
1057
- *
1058
- * // Printing the header name
1059
- * console.log(timing.getRequestTagHeader());
1060
- * ```
1061
- *
1062
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
1063
- */
1064
- getRequestTagHeader(): string;
1065
-
1066
- }
1067
-
1068
- /**
1069
- * Class which gives you the option to measure a web request
1070
- */
1071
- export declare class DynatraceWebRequestTiming implements IDynatraceWebRequestTiming{
1072
-
1073
- /**
1074
- * Constructor for creating a DynatraceWebRequestTiming
1075
- *
1076
- * @param {string} requestTag Request Tag for the action to be linked to
1077
- * @param {string} url URL that should be linked
1078
- *
1079
- * Usage (with Axios example):
1080
- *
1081
- * ```ts
1082
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
1083
- *
1084
- * const action = Dynatrace.enterManualAction("Manual Web Request");
1085
- * const tag = await action.getRequestTag(url);
1086
- * const timing = new DynatraceWebRequestTiming(url, tag);
1087
- *
1088
- * try {
1089
- * timing.startWebRequestTiming();
1090
- * const axiosResponse = await axios.get(url, {
1091
- * headers: {
1092
- * timing.getRequestTagHeader(): tag
1093
- * }
1094
- * });
1095
- * timing.stopWebRequestTiming(axiosResponse.status, axiosResponse.data);
1096
- * } catch (error) {
1097
- * timing.stopWebRequestTiming(-1, error);
1098
- * } finally {
1099
- * action.leaveAction();
1100
- * }
1101
- * ```
1102
- *
1103
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
1104
- */
1105
- constructor(requestTag: string, url: string);
1106
-
1107
- /**
1108
- * Start the measurment of the web request. Call this before the request is started.
1109
- *
1110
- * Usage (with Axios example):
1111
- *
1112
- * ```ts
1113
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
1114
- *
1115
- * const action = Dynatrace.enterManualAction("Manual Web Request");
1116
- * const tag = await action.getRequestTag(url);
1117
- * const timing = new DynatraceWebRequestTiming(url, tag);
1118
- *
1119
- * try {
1120
- * timing.startWebRequestTiming();
1121
- * const axiosResponse = await axios.get(url, {
1122
- * headers: {
1123
- * timing.getRequestTagHeader(): tag
1124
- * }
1125
- * });
1126
- * timing.stopWebRequestTiming(axiosResponse.status, axiosResponse.data);
1127
- * } catch (error) {
1128
- * timing.stopWebRequestTiming(-1, error);
1129
- * } finally {
1130
- * action.leaveAction();
1131
- * }
1132
- * ```
1133
- *
1134
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
1135
- */
1136
- startWebRequestTiming(): void;
1137
-
1138
- /**
1139
- * Stops the measurment of the web request. This needs to be called after the request is executed.
1140
- * The responseCode and responseMessage will be transfered and shown in the web UI.
1141
- *
1142
- * @param {number} responseCode Status Code of the response e.g. 200
1143
- * @param {string} responseMessage Message of the response
1144
- *
1145
- * Usage (with Axios example):
1146
- *
1147
- * ```ts
1148
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
1149
- *
1150
- * const action = Dynatrace.enterManualAction("Manual Web Request");
1151
- * const tag = await action.getRequestTag(url);
1152
- * const timing = new DynatraceWebRequestTiming(url, tag);
1153
- *
1154
- * try {
1155
- * timing.startWebRequestTiming();
1156
- * const axiosResponse = await axios.get(url, {
1157
- * headers: {
1158
- * timing.getRequestTagHeader(): tag
1159
- * }
1160
- * });
1161
- * timing.stopWebRequestTiming(axiosResponse.status, axiosResponse.data);
1162
- * } catch (error) {
1163
- * timing.stopWebRequestTiming(-1, error);
1164
- * } finally {
1165
- * action.leaveAction();
1166
- * }
1167
- * ```
1168
- *
1169
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
1170
- */
1171
- stopWebRequestTiming(responseCode: number, responseMessage: string): void;
1172
-
1173
- /**
1174
- * Stops the measurment of the web request. This needs to be called after the request is executed.
1175
- * The responseCode and responseMessage will be transfered and shown in the web UI.
1176
- *
1177
- * @param {number} responseCode Status Code of the response e.g. 200
1178
- * @param {string} responseMessage Message of the response
1179
- * @param requestSize Request size
1180
- * @param responseSize Response size
1181
- *
1182
- * Usage (with Axios example):
1183
- *
1184
- * ```ts
1185
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
1186
- *
1187
- * const action = Dynatrace.enterManualAction("Manual Web Request");
1188
- * const tag = await action.getRequestTag(url);
1189
- * const timing = new DynatraceWebRequestTiming(url, tag);
1190
- *
1191
- * try {
1192
- * timing.startWebRequestTiming();
1193
- * const axiosResponse = await axios.get(url, {
1194
- * headers: {
1195
- * timing.getRequestTagHeader(): tag
1196
- * }
1197
- * });
1198
- * timing.stopWebRequestTimingWithSize(axiosResponse.status, axiosResponse.data, 122, 63);
1199
- * } catch (error) {
1200
- * timing.stopWebRequestTiming(-1, error);
1201
- * } finally {
1202
- * action.leaveAction();
1203
- * }
1204
- * ```
1205
- *
1206
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
1207
- */
1208
- stopWebRequestTimingWithSize(responseCode: number, responseMessage: string, requestSize: number, responseSize: number): void;
1209
-
1210
- /**
1211
- * Returns the content for the header that is needed in order to track a request
1212
- *
1213
- * @returns {string} header tag which should be applied onto the request
1214
- *
1215
- * Usage:
1216
- *
1217
- * ```ts
1218
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
1219
- *
1220
- * const action = Dynatrace.enterManualAction("Manual Web Request");
1221
- * const tag = await action.getRequestTag(url);
1222
- * const timing = new DynatraceWebRequestTiming(url, tag);
1223
- *
1224
- * // Printing the same tag which was used as input for DynatraceWebRequestTiming
1225
- * console.log(timing.getRequestTag());
1226
- * ```
1227
- *
1228
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
1229
- */
1230
- getRequestTag(): string;
1231
-
1232
- /**
1233
- * Returns the name for the header that is needed in order to track a request
1234
- *
1235
- * @returns {string} name of the header that should be used for tagging a request
1236
- *
1237
- * Usage:
1238
- *
1239
- * ```ts
1240
- * import { Dynatrace, DynatraceWebRequestTiming } from '@dynatrace/react-native-plugin'
1241
- *
1242
- * const action = Dynatrace.enterManualAction("Manual Web Request");
1243
- * const tag = await action.getRequestTag(url);
1244
- * const timing = new DynatraceWebRequestTiming(url, tag);
1245
- *
1246
- * // Printing the header name
1247
- * console.log(timing.getRequestTagHeader());
1248
- * ```
1249
- *
1250
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#manual-web-request-tagging
1251
- */
1252
- getRequestTagHeader(): string;
1253
- }
1254
-
1255
- /**
1256
- * Represents the privacy settings that the user can select
1257
- */
1258
- export declare class UserPrivacyOptions {
1259
-
1260
- /**
1261
- * Constructor for creation of a privacy settings object
1262
- * @param {DataCollectionLevel} dataCollectionLevel Data collection level.
1263
- * @param {boolean} crashReportingOptedIn If crash reporting should be enabled.
1264
- *
1265
- * Usage:
1266
- *
1267
- * ```ts
1268
- * import { DataCollectionLevel, UserPrivacyOptions } from '@dynatrace/react-native-plugin';
1269
- *
1270
- * const privacyConfig = new UserPrivacyOptions(DataCollectionLevel.Off, false);
1271
- * ```
1272
- *
1273
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
1274
- */
1275
- constructor(dataCollectionLevel: DataCollectionLevel, crashReportingOptedIn: boolean);
1276
-
1277
- /**
1278
- * Returns the specified data collection level.
1279
- *
1280
- * @returns {DataCollectionLevel} the specified data collection level
1281
- *
1282
- * Usage:
1283
- *
1284
- * ```ts
1285
- * import { DataCollectionLevel, UserPrivacyOptions } from '@dynatrace/react-native-plugin';
1286
- *
1287
- * const privacyConfig = new UserPrivacyOptions(DataCollectionLevel.Off, false);
1288
- * const dataCollectionLevel = privacyConfig.dataCollectionLevel;
1289
- * ```
1290
- *
1291
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
1292
- */
1293
- get dataCollectionLevel(): DataCollectionLevel;
1294
-
1295
- /**
1296
- * Sets the data collection level specified by the user.
1297
- *
1298
- * @param {DataCollectionLevel} dataCollectionLevel the specified data collection level from the user
1299
- *
1300
- * Usage:
1301
- *
1302
- * ```ts
1303
- * import { DataCollectionLevel, UserPrivacyOptions } from '@dynatrace/react-native-plugin';
1304
- *
1305
- * const privacyConfig = new UserPrivacyOptions(DataCollectionLevel.Off, false);
1306
- * privacyConfig.dataCollectionLevel = DataCollectionLevel.Performance;
1307
- * ```
1308
- *
1309
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
1310
- */
1311
- set dataCollectionLevel(dataCollectionLevel: DataCollectionLevel);
1312
-
1313
- /**
1314
- * Returns the opt-in value for crash reporting.
1315
- *
1316
- * @return {boolean} the opt-in value for crash reporting
1317
- *
1318
- * Usage:
1319
- *
1320
- * ```ts
1321
- * import { DataCollectionLevel, UserPrivacyOptions } from '@dynatrace/react-native-plugin';
1322
- *
1323
- * const privacyConfig = new UserPrivacyOptions(DataCollectionLevel.Off, false);
1324
- * const crashReporting = privacyConfig.crashReportingOptedIn;
1325
- * ```
1326
- *
1327
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
1328
- */
1329
- get crashReportingOptedIn(): boolean;
1330
-
1331
- /**
1332
- * Sets the privacy setting for crash reporting.
1333
- *
1334
- * @param {boolean} crashReportingOptedIn the opt-in value specified by the user
1335
- *
1336
- * Usage:
1337
- *
1338
- * ```ts
1339
- * import { DataCollectionLevel, UserPrivacyOptions } from '@dynatrace/react-native-plugin';
1340
- *
1341
- * const privacyConfig = new UserPrivacyOptions(DataCollectionLevel.Off, false);
1342
- * privacyConfig.crashReportingOptedIn = true;
1343
- * ```
1344
- *
1345
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#user-privacy-options
1346
- */
1347
- set crashReportingOptedIn(crashReportingOptedIn: boolean);
1348
- }
1349
-
1350
- /**
1351
- * Configuration interface which should be used during a manual startup
1352
- */
1353
- export declare interface IConfiguration {
1354
-
1355
- /**
1356
- * Beacon url which is used for communicate with the beacon endpoint. This value is mandatory.
1357
- *
1358
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1359
- * native agent configuration.
1360
- */
1361
- readonly beaconUrl: string;
1362
-
1363
- /**
1364
- * Needed to identify and report data for this application. This value is mandatory.
1365
- *
1366
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1367
- * native agent configuration.
1368
- */
1369
- readonly applicationId: string;
1370
-
1371
- /**
1372
- * Enables reporting of crashes. By default this value is true if nothing is passed.
1373
- *
1374
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1375
- * native agent configuration.
1376
- */
1377
- readonly reportCrash: boolean;
1378
-
1379
- /**
1380
- * Enables the react native error/crash handler. By default this value is true if nothing is passed.
1381
- *
1382
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1383
- * react configuration.
1384
- */
1385
- readonly errorHandler: boolean;
1386
-
1387
- /**
1388
- * Reports a fatal error as a crash or as an error.
1389
- * The default value of true results in an unhandled fatal error being reported as a crash which will also end the current session.
1390
- * If the value is false, the unhandled fatal error will be reported as an error and the current session will continue.
1391
- *
1392
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1393
- * react configuration.
1394
- */
1395
- readonly reportFatalErrorAsCrash: boolean;
1396
-
1397
- /**
1398
- * Log level of our plugin during application runtime. By default this values is LogLevel.Info, if nothing is passed.
1399
- */
1400
- readonly logLevel: LogLevel;
1401
-
1402
- /**
1403
- * Decide if you want to see update cycles on lifecycle actions as well.
1404
- * By default this value is false, if nothing is passed. Be aware as this creates a lot more data.
1405
- */
1406
- readonly lifecycleUpdate: boolean;
1407
-
1408
- /**
1409
- * Activates the privacy mode when set to true. User consent must be queried and set.
1410
- * The privacy settings for data collection and crash reporting can be changed via OneAgent SDK
1411
- * for Mobile as described under Data privacy. By default this value is false, if nothing is passed.
1412
- *
1413
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1414
- * native agent configuration.
1415
- */
1416
- readonly userOptIn: boolean;
1417
-
1418
- /**
1419
- * Activates a privacy mode especially for Touchables and Buttons. Setting this option to true
1420
- * means that a name for the control will no longer be shown, e.g. "Touch on Button".
1421
- * When setting a dtActionName onto the component this setting will be ignored. By default this value is false,
1422
- * if nothing is passed.
1423
- */
1424
- readonly actionNamePrivacy: boolean;
1425
-
1426
- /**
1427
- * Will define the bundle name which will prefix internal action ids.
1428
- */
1429
- readonly bundleName?: string;
1430
-
1431
- /**
1432
- * Will define the bundle version which will extend bundleName signature.
1433
- */
1434
- readonly bundleVersion?: string;
1435
- }
1436
-
1437
- /**
1438
- * Manual startup configuration which is used for Dynatrace.start()
1439
- * @deprecated Use ConfigurationBuilder and IConfiguration instead
1440
- */
1441
- export declare class ManualStartupConfiguration implements IConfiguration {
1442
- /**
1443
- * Creates a Manual Startup configuration instance
1444
- *
1445
- * @param {string} beaconUrl Identifies your environment within Dynatrace. This property is mandatory for manual startup
1446
- * @param {string} applicationId Identifies your mobile app. This property is mandatory for manual startup
1447
- * @param {boolean} reportCrash Allows reporting React Native crashes.
1448
- * @param {LogLevel} logLevel Allows you to choose between `LogLevel.Info` and `LogLevel.Debug`. Debug returns more logs. This is especially important when something is not functioning correctly.
1449
- * @param {boolean} lifecycleUpdate Decide if you want to see update cycles on lifecycle actions as well. This is per default false as it creates a lot more actions.
1450
- * @param {boolean} userOptIn Activates the privacy mode when set to `true`. User consent must be queried and set.
1451
- * @param {boolean} actionNamePrivacy Activates a privacy mode especially for Touchables and Buttons. Setting this option to true means that a name for the control will no longer be shown, e.g. "Touch on Button". When setting a dtActionName onto the component this setting will be ignored.
1452
- * @param {string} bundleName Will define the bundle name which will prefix internal action ids.
1453
- * @param {string} bundleVersion Will define the bundle version which will extend bundleName signature.
1454
- *
1455
- * @deprecated Use ConfigurationBuilder and IConfiguration instead
1456
- */
1457
- constructor(beaconUrl: string, applicationId: string, reportCrash?: boolean,
1458
- logLevel?: LogLevel, lifecycleUpdate?: boolean, userOptIn?: boolean,
1459
- actionNamePrivacy?: boolean, bundleName?: string, bundleVersion?: string);
1460
-
1461
- /**
1462
- * Beacon url which is used for communicate with the beacon endpoint. This value is mandatory.
1463
- *
1464
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1465
- * native agent configuration.
1466
- */
1467
- readonly beaconUrl: string;
1468
-
1469
- /**
1470
- * Needed to identify and report data for this application. This value is mandatory.
1471
- *
1472
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1473
- * native agent configuration.
1474
- */
1475
- readonly applicationId: string;
1476
-
1477
- /**
1478
- * Enables reporting of crashes. By default this value is true if nothing is passed.
1479
- *
1480
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1481
- * native agent configuration.
1482
- */
1483
- readonly reportCrash: boolean;
1484
-
1485
- /**
1486
- * Enables the react native error/crash handler. By default this value is true if nothing is passed.
1487
- *
1488
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1489
- * react configuration.
1490
- */
1491
- readonly errorHandler: boolean;
1492
-
1493
- /**
1494
- * Reports a fatal error as a crash or as an error.
1495
- * The default value of true results in an unhandled fatal error being reported as a crash which will also end the current session.
1496
- * If the value is false, the unhandled fatal error will be reported as an error and the current session will continue.
1497
- *
1498
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1499
- * react configuration.
1500
- */
1501
- readonly reportFatalErrorAsCrash: boolean;
1502
-
1503
- /**
1504
- * Log level of our plugin during application runtime. By default this values is LogLevel.Info, if nothing is passed.
1505
- */
1506
- readonly logLevel: LogLevel;
1507
-
1508
- /**
1509
- * Decide if you want to see update cycles on lifecycle actions as well.
1510
- * By default this value is false, if nothing is passed. Be aware as this creates a lot more data.
1511
- */
1512
- readonly lifecycleUpdate: boolean;
1513
-
1514
- /**
1515
- * Activates the privacy mode when set to true. User consent must be queried and set.
1516
- * The privacy settings for data collection and crash reporting can be changed via OneAgent SDK
1517
- * for Mobile as described under Data privacy. By default this value is false, if nothing is passed.
1518
- *
1519
- * Be aware this value is only important for manual startup. In case of auto startup this needs to be handled via
1520
- * native agent configuration.
1521
- */
1522
- readonly userOptIn: boolean;
1523
-
1524
- /**
1525
- * Activates a privacy mode especially for Touchables and Buttons. Setting this option to true
1526
- * means that a name for the control will no longer be shown, e.g. "Touch on Button".
1527
- * When setting a dtActionName onto the component this setting will be ignored. By default this value is false,
1528
- * if nothing is passed.
1529
- */
1530
- readonly actionNamePrivacy: boolean;
1531
-
1532
- /**
1533
- * Will define the bundle name which will prefix internal action ids.
1534
- */
1535
- readonly bundleName?: string;
1536
-
1537
- /**
1538
- * Will define the bundle version which will extend bundleName signature.
1539
- */
1540
- readonly bundleVersion?: string;
1541
- }
1542
-
1543
- /**
1544
- * Builder for Manual startup configuration which is used for Dynatrace.start()
1545
- */
1546
- export declare class ConfigurationBuilder {
1547
-
1548
- /**
1549
- * Creates a builder for Manual Startup configuration
1550
- *
1551
- * @param {string} beaconUrl Identifies your environment within Dynatrace. This property is mandatory for manual startup
1552
- * @param {string} applicationId Identifies your mobile app. This property is mandatory for manual startup
1553
- *
1554
- * Usage:
1555
- *
1556
- * ```ts
1557
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
1558
- *
1559
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1560
- * Dynatrace.start(configurationBuilder.buildConfiguration());
1561
- * ```
1562
- *
1563
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1564
- */
1565
- constructor(beaconUrl: string, applicationId: string);
1566
-
1567
- /**
1568
- * Builder function to handle crash reporting property. By default this is true. Usually
1569
- * this API only needs to be called in case you want to use `withCrashReporting(false)`.
1570
- *
1571
- * @param {boolean} reportCrash Allows reporting React Native crashes.
1572
- *
1573
- * Usage:
1574
- *
1575
- * ```ts
1576
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
1577
- *
1578
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1579
- * Dynatrace.start(configurationBuilder.withCrashReporting(true).buildConfiguration());
1580
- * ```
1581
- *
1582
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1583
- */
1584
- public withCrashReporting(reportCrash: boolean): ConfigurationBuilder;
1585
-
1586
- /**
1587
- * Builder function to handle error handler property. By default this is true. Usually
1588
- * this API only needs to be called in case you want to use `withErrorHandler(false)`.
1589
- *
1590
- * @param {boolean} errorHandler Allows you to enable or disable the Dynatrace React Native error handler.
1591
- *
1592
- * Usage:
1593
- *
1594
- * ```ts
1595
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
1596
- *
1597
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1598
- * Dynatrace.start(configurationBuilder.withErrorHandler(true).buildConfiguration());
1599
- * ```
1600
- *
1601
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1602
- */
1603
- public withErrorHandler(errorHandler: boolean): ConfigurationBuilder;
1604
-
1605
- /**
1606
- * Builder function to handle preventing crash property. By default this is true. Usually
1607
- * this API only needs to be called in case you want to use `withReportFatalErrorAsCrash(false)`.
1608
- *
1609
- * @param {boolean} reportFatalErrorAsCrash If you want to report a fatal error as an error and not as a crash, set this to false.
1610
- *
1611
- * Usage:
1612
- *
1613
- * ```ts
1614
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
1615
- *
1616
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1617
- * Dynatrace.start(configurationBuilder.withReportFatalErrorAsCrash(true).buildConfiguration());
1618
- * ```
1619
- *
1620
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1621
- */
1622
- public withReportFatalErrorAsCrash(reportFatalErrorAsCrash: boolean): ConfigurationBuilder;
1623
-
1624
- /**
1625
- * Builder function to handle loglevel property. By default this is LogLevel.Info. Usually
1626
- * this API only needs to be called in case you want to use `withLogLevel(LogLevel.Debug)`.
1627
- *
1628
- * @param {LogLevel} logLevel Allows you to choose between `LogLevel.Info` and `LogLevel.Debug`. Debug returns more logs. This is especially important when something is not functioning correctly.
1629
- *
1630
- * Usage:
1631
- *
1632
- * ```ts
1633
- * import { ConfigurationBuilder, Dynatrace, LogLevel } from '@dynatrace/react-native-plugin';
1634
- *
1635
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1636
- * Dynatrace.start(configurationBuilder.withLogLevel(LogLevel.Debug).buildConfiguration());
1637
- * ```
1638
- *
1639
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1640
- */
1641
- public withLogLevel(logLevel: LogLevel): ConfigurationBuilder;
1642
-
1643
- /**
1644
- * Builder function to handle lifecycle update property. By default this is false. Usually
1645
- * this API only needs to be called in case you want to use `withLifecycleUpdate(true)`.
1646
- *
1647
- * @param {boolean} lifecycleUpdate Decide if you want to see update cycles on lifecycle actions as well. This is per default false as it creates a lot more actions.
1648
- *
1649
- * Usage:
1650
- *
1651
- * ```ts
1652
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
1653
- *
1654
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1655
- * Dynatrace.start(configurationBuilder.withLifecycleUpdate(false).buildConfiguration());
1656
- * ```
1657
- *
1658
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1659
- */
1660
- public withLifecycleUpdate(lifecycleUpdate: boolean): ConfigurationBuilder
1661
-
1662
- /**
1663
- * Builder function to handle user opt in property. By default this is false. Usually
1664
- * this API only needs to be called in case you want to use `withUserOptIn(true)`.
1665
- *
1666
- * @param {boolean} userOptIn Activates the privacy mode when set to `true`. User consent must be queried and set.
1667
- *
1668
- * Usage:
1669
- *
1670
- * ```ts
1671
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
1672
- *
1673
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1674
- * Dynatrace.start(configurationBuilder.withUserOptIn(true).buildConfiguration());
1675
- * ```
1676
- *
1677
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1678
- */
1679
- public withUserOptIn(userOptIn: boolean): ConfigurationBuilder;
1680
-
1681
- /**
1682
- * Builder function to handle action name privacy property. By default this is false. Usually
1683
- * this API only needs to be called in case you want to use `withActionNamePrivacy(true)`.
1684
- *
1685
- * @param {boolean} actionNamePrivacy Activates a privacy mode especially for Touchables and Buttons. Setting this option to true means that a name for the control will no longer be shown, e.g. "Touch on Button". When setting a dtActionName onto the component this setting will be ignored.
1686
- *
1687
- * Usage:
1688
- *
1689
- * ```ts
1690
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
1691
- *
1692
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1693
- * Dynatrace.start(configurationBuilder.withActionNamePrivacy(true).buildConfiguration());
1694
- * ```
1695
- *
1696
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1697
- */
1698
- public withActionNamePrivacy(actionNamePrivacy: boolean): ConfigurationBuilder;
1699
-
1700
- /**
1701
- * Builder function to handle bundle name property
1702
- *
1703
- * @param {string} bundleName Will define the bundle name which will prefix internal action ids.
1704
- *
1705
- * Usage:
1706
- *
1707
- * ```ts
1708
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
1709
- *
1710
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1711
- * Dynatrace.start(configurationBuilder.withBundleName("bundleName").buildConfiguration());
1712
- * ```
1713
- *
1714
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1715
- */
1716
- public withBundleName(bundleName: string): ConfigurationBuilder;
1717
-
1718
-
1719
- /**
1720
- * Builder function to handle bundle name property
1721
- *
1722
- * @param {string} bundleName Will define the bundle name which will prefix internal action ids.
1723
- *
1724
- * Usage:
1725
- *
1726
- * ```ts
1727
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
1728
- *
1729
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1730
- * Dynatrace.start(configurationBuilder.withBundleName("bundleName").buildConfiguration());
1731
- * ```
1732
- *
1733
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1734
- */
1735
- public withBundleVersion(bundleName: string): ConfigurationBuilder;
1736
-
1737
- /**
1738
- * Build configuration which is used for startup
1739
- *
1740
- * Usage:
1741
- *
1742
- * ```ts
1743
- * import { ConfigurationBuilder, Dynatrace } from '@dynatrace/react-native-plugin';
1744
- *
1745
- * const configurationBuilder = new ConfigurationBuilder("beaconUrl", "applicationId");
1746
- * Dynatrace.start(configurationBuilder.buildConfiguration());
1747
- * ```
1748
- *
1749
- * @see https://www.npmjs.com/package/@dynatrace/react-native-plugin#plugin-startup
1750
- */
1751
- public buildConfiguration(): IConfiguration;
1752
- }
1753
-
1754
- type EventProperty = string | number | boolean;
1755
- type TraceparentHeader = `00-${string}-${string}-0${'0' | '1'}`;
1756
- type AllowedRequestMethods =
1757
- | 'GET'
1758
- | 'HEAD'
1759
- | 'POST'
1760
- | 'PUT'
1761
- | 'DELETE'
1762
- | 'CONNECT'
1763
- | 'OPTIONS'
1764
- | 'TRACE'
1765
- | 'PATCH'
1766
- | 'get'
1767
- | 'head'
1768
- | 'post'
1769
- | 'put'
1770
- | 'delete'
1771
- | 'connect'
1772
- | 'options'
1773
- | 'trace'
1774
- | 'patch';
1775
-
1776
- export declare class HttpRequestEventBuilder {
1777
- /**
1778
- *
1779
- * @param url Accepts only URLs that are valid according to the WHATWG URL Standard. Mandatory.
1780
- * @param requestMethod Accepts GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE and PATCH. Mandatory
1781
- */
1782
- constructor(
1783
- url: `http://${string}` | `https://${string}`,
1784
- requestMethod: AllowedRequestMethods
1785
- );
1786
-
1787
- /**
1788
- *
1789
- * @param duration Only positive numbers are valid.
1790
- * @returns the HttpRequestEventBuilder
1791
- */
1792
- withDuration(duration: number): this;
1793
-
1794
- /**
1795
- *
1796
- * @param statusCode Only positive numbers are valid.
1797
- * @returns the HttpRequestEventBuilder
1798
- */
1799
- withStatusCode(statusCode: number): this;
1800
-
1801
- /**
1802
- *
1803
- * @param reasonPhrase Max. 5000 characters.
1804
- * @returns the HttpRequestEventBuilder
1805
- */
1806
- withReasonPhrase(reasonPhrase: string): this;
1807
-
1808
- /**
1809
- *
1810
- * @param error A standard Javascript Error Object.
1811
- * @returns the HttpRequestEventBuilder
1812
- */
1813
- withError(error: Error): this;
1814
-
1815
- /**
1816
- *
1817
- * @param bytesSent Only positive numbers are valid.
1818
- * @returns the HttpRequestEventBuilder
1819
- */
1820
- withBytesSent(bytesSent: number): this;
1821
-
1822
- /**
1823
- *
1824
- * @param bytesReceived Only positive numbers are valid.
1825
- * @returns the HttpRequestEventBuilder
1826
- */
1827
- withBytesReceived(bytesReceived: number): this;
1828
-
1829
- /**
1830
- *
1831
- * @param traceparentHeader Accepts Traceparent Headers that are valid according to the W3C Trace Context Specification.
1832
- * @returns the HttpRequestEventBuilder
1833
- */
1834
- withTraceparentHeader(traceparentHeader: TraceparentHeader): this;
1835
-
1836
- /**
1837
- *
1838
- * @param key Accepts any string that starts with 'event_properties.'.
1839
- * @param value Accepts any string (max. 5000 characters), number or boolean.
1840
- * @returns the HttpRequestEventBuilder
1841
- */
1842
- addEventProperty(key: `event_properties.${string}`, value: EventProperty): this;
1843
- }
1844
-
1845
- declare module 'react' {
1846
- namespace JSX {
1847
- interface IntrinsicAttributes extends IDynatraceProperties {}
1848
- }
1849
- }