@crimson-education/browser-logger 3.0.4 → 3.0.5

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/lib/index.d.ts +12 -12
  2. package/lib/index.js +69 -69
  3. package/lib/logger/consoleTransport.d.ts +36 -36
  4. package/lib/logger/consoleTransport.js +80 -80
  5. package/lib/logger/datadogTransport.d.ts +7 -7
  6. package/lib/logger/datadogTransport.js +20 -20
  7. package/lib/logger/index.d.ts +15 -15
  8. package/lib/logger/index.js +147 -147
  9. package/lib/logger/index.test.d.ts +1 -1
  10. package/lib/logger/index.test.js +59 -59
  11. package/lib/logger/utils.d.ts +14 -14
  12. package/lib/logger/utils.js +31 -31
  13. package/lib/reporters/amplifyReporter.d.ts +85 -85
  14. package/lib/reporters/amplifyReporter.d.ts.map +1 -1
  15. package/lib/reporters/amplifyReporter.js +222 -215
  16. package/lib/reporters/amplifyReporter.js.map +1 -1
  17. package/lib/reporters/amplifyReporter.test.d.ts +1 -1
  18. package/lib/reporters/amplifyReporter.test.js +50 -50
  19. package/lib/reporters/datadogReporter.d.ts +85 -85
  20. package/lib/reporters/datadogReporter.js +124 -124
  21. package/lib/reporters/gtmReporter.d.ts +8 -8
  22. package/lib/reporters/gtmReporter.js +56 -56
  23. package/lib/reporters/index.d.ts +66 -66
  24. package/lib/reporters/index.js +212 -212
  25. package/lib/reporters/logReporter.d.ts +34 -34
  26. package/lib/reporters/logReporter.js +61 -61
  27. package/lib/types/index.d.ts +2 -2
  28. package/lib/types/index.js +18 -18
  29. package/lib/types/logger.d.ts +77 -77
  30. package/lib/types/logger.js +10 -10
  31. package/lib/types/reporter.d.ts +154 -154
  32. package/lib/types/reporter.js +2 -2
  33. package/lib/utils.d.ts +9 -9
  34. package/lib/utils.js +31 -31
  35. package/lib/utils.test.d.ts +1 -1
  36. package/lib/utils.test.js +31 -31
  37. package/package.json +1 -1
  38. package/src/reporters/amplifyReporter.ts +7 -0
@@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AAQ,EAAE,QAAQ,CAAC,QAAQ;gBAC3B,kEAAkE;gBAClE,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,QAAQ,CAAC,QAAQ;aAC5B,CAAC,CAAC;YAEL,cAAc,CAAC,eAAe,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;YACzD,cAAc,CAAC,eAAe,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC;SACpF;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=amplifyReporter.test.d.ts.map
@@ -1,51 +1,51 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const amplifyReporter_1 = require("./amplifyReporter");
4
- describe('amplifyReporter', () => {
5
- it('should convert all attribute values to arrays of strings', () => {
6
- const testMetadata = { a: 'a', d: ['e', 'f'] };
7
- const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
8
- expect(attributeMap.a).toEqual(['a']);
9
- expect(attributeMap.d).toEqual(['e', 'f']);
10
- });
11
- it('should handle undefined / null attributes', () => {
12
- const testMetadata = { a: null, d: undefined };
13
- const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
14
- expect(attributeMap.a).toBeNull();
15
- expect(attributeMap.d).toBeNull();
16
- });
17
- it('should flatten hierarchies', () => {
18
- const testMetadata = { foo: { bar: 'baz' } };
19
- const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
20
- expect(attributeMap['foo.bar']).toEqual(['baz']);
21
- });
22
- it('should stringify non-string array members', () => {
23
- var _a;
24
- const testMetadata = { foo: 5, bar: [{ baz: 'maz' }] };
25
- const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
26
- expect(attributeMap.foo).toEqual(['5']);
27
- expect(typeof ((_a = attributeMap.bar) === null || _a === void 0 ? void 0 : _a[0])).toEqual('string');
28
- });
29
- it('should truncate attribute names', () => {
30
- const testMetadata = { thisIsAVeryVeryLongAttributeNameThatNeedsToBeTruncated: 5 };
31
- const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
32
- expect(attributeMap.___VeryVeryLongAttributeNameThatNeedsToBeTruncated).toEqual(['5']);
33
- });
34
- it('should truncate attribute values', () => {
35
- const testMetadata = {
36
- a: 'ThisIsAVeryLongStringThatNeedsToBeTruncatedTo100CharsOrElseThereWillBeAProblemWithSendingTheBeautifulDataToPinpoint',
37
- };
38
- const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
39
- expect(attributeMap.a).toEqual([
40
- 'ThisIsAVeryLongStringThatNeedsToBeTruncatedTo100CharsOrElseThereWillBeAProblemWithSendingTheBeautifu',
41
- ]);
42
- });
43
- it('should not group values into arrays when groupValues===false', () => {
44
- const testMetadata = {
45
- a: '5',
46
- };
47
- const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata, false);
48
- expect(attributeMap.a).toEqual('5');
49
- });
50
- });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const amplifyReporter_1 = require("./amplifyReporter");
4
+ describe('amplifyReporter', () => {
5
+ it('should convert all attribute values to arrays of strings', () => {
6
+ const testMetadata = { a: 'a', d: ['e', 'f'] };
7
+ const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
8
+ expect(attributeMap.a).toEqual(['a']);
9
+ expect(attributeMap.d).toEqual(['e', 'f']);
10
+ });
11
+ it('should handle undefined / null attributes', () => {
12
+ const testMetadata = { a: null, d: undefined };
13
+ const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
14
+ expect(attributeMap.a).toBeNull();
15
+ expect(attributeMap.d).toBeNull();
16
+ });
17
+ it('should flatten hierarchies', () => {
18
+ const testMetadata = { foo: { bar: 'baz' } };
19
+ const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
20
+ expect(attributeMap['foo.bar']).toEqual(['baz']);
21
+ });
22
+ it('should stringify non-string array members', () => {
23
+ var _a;
24
+ const testMetadata = { foo: 5, bar: [{ baz: 'maz' }] };
25
+ const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
26
+ expect(attributeMap.foo).toEqual(['5']);
27
+ expect(typeof ((_a = attributeMap.bar) === null || _a === void 0 ? void 0 : _a[0])).toEqual('string');
28
+ });
29
+ it('should truncate attribute names', () => {
30
+ const testMetadata = { thisIsAVeryVeryLongAttributeNameThatNeedsToBeTruncated: 5 };
31
+ const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
32
+ expect(attributeMap.___VeryVeryLongAttributeNameThatNeedsToBeTruncated).toEqual(['5']);
33
+ });
34
+ it('should truncate attribute values', () => {
35
+ const testMetadata = {
36
+ a: 'ThisIsAVeryLongStringThatNeedsToBeTruncatedTo100CharsOrElseThereWillBeAProblemWithSendingTheBeautifulDataToPinpoint',
37
+ };
38
+ const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata);
39
+ expect(attributeMap.a).toEqual([
40
+ 'ThisIsAVeryLongStringThatNeedsToBeTruncatedTo100CharsOrElseThereWillBeAProblemWithSendingTheBeautifu',
41
+ ]);
42
+ });
43
+ it('should not group values into arrays when groupValues===false', () => {
44
+ const testMetadata = {
45
+ a: '5',
46
+ };
47
+ const attributeMap = (0, amplifyReporter_1.asAttributeMap)(testMetadata, false);
48
+ expect(attributeMap.a).toEqual('5');
49
+ });
50
+ });
51
51
  //# sourceMappingURL=amplifyReporter.test.js.map
@@ -1,86 +1,86 @@
1
- import { IReporter, ServiceInfo, ReporterConfigBase } from '../types';
2
- import { LogsInitConfiguration } from '@datadog/browser-logs';
3
- import { DefaultPrivacyLevel, RumInitConfiguration } from '@datadog/browser-rum';
4
- import { DatadogLogTransportConfig } from '../logger/datadogTransport';
5
- export interface DatadogReporterConfig extends ReporterConfigBase {
6
- /** The RUM application ID. */
7
- applicationId: string;
8
- /** A Datadog client token (Generated in the RUM Page) */
9
- clientToken: string;
10
- /** The Datadog site parameter of your organization. */
11
- site: string;
12
- /** The Application's version (Overrides the browser logger version) */
13
- version?: string;
14
- /** Optional proxy URL */
15
- proxyUrl?: string;
16
- /**
17
- * Controls the percentage of overall sessions being tracked. It defaults to 100, so every session is tracked by default.
18
- */
19
- sampleRate?: number;
20
- /**
21
- * Applied after the overall sample rate, and controls the percentage of sessions tracked as Browser RUM & Session Replay.
22
- * It defaults to 100, so every session is tracked as Browser RUM & Session Replay by default.
23
- */
24
- replaySampleRate?: number;
25
- /**
26
- * Use a secure session cookie. This disables RUM events sent on insecure (non-HTTPS) connections.
27
- */
28
- useSecureSessionCookie?: boolean;
29
- /**
30
- * Use a secure cross-site session cookie.
31
- * This allows the RUM Browser SDK to run when the site is loaded from another one (iframe). Implies `useSecureSessionCookie`
32
- */
33
- useCrossSiteSessionCookie?: boolean;
34
- /**
35
- * Preserve the session across subdomains for the same site.
36
- */
37
- trackSessionAcrossSubdomains?: boolean;
38
- /**
39
- * Forward console.error logs, uncaught exceptions and network errors to Datadog.
40
- * Defaults to false.
41
- */
42
- forwardConsoleLogs?: boolean;
43
- /**
44
- * Enables automatic collection of users actions.
45
- */
46
- trackInteractions?: boolean;
47
- /**
48
- * Enables automatic collection of user frustrations. Implies `trackInteractions`: true.
49
- */
50
- trackFrustrations?: boolean;
51
- /**
52
- * Allows you to control RUM views creation.
53
- * You will need to call `Logger.setPageName()` to create a new view.
54
- */
55
- trackViewsManually?: boolean;
56
- /**
57
- * Specify your own attribute to be used to name actions.
58
- * Defaults to `data-analytics-name` to coincide with analytics attributes used across reporters.
59
- */
60
- actionNameAttribute?: string;
61
- /**
62
- * Allows you to modify RUM events before they are sent to Datadog.
63
- */
64
- beforeSend?: RumInitConfiguration['beforeSend'];
65
- /**
66
- * Toggles/configures the Datadog Log Transport.
67
- * Defaults to true.
68
- */
69
- logTransport?: boolean | DatadogLogTransportConfig;
70
- /**
71
- * Allows you to modify Log events before they are sent to Datadog (Can only be set at ).
72
- */
73
- beforeLogsSend?: LogsInitConfiguration['beforeSend'];
74
- /**
75
- * By enabling Session Replay, you can automatically mask sensitive elements from being recorded through the RUM Browser SDK.
76
- *
77
- * See https://docs.datadoghq.com/real_user_monitoring/session_replay/privacy_options
78
- */
79
- defaultPrivacyLevel?: DefaultPrivacyLevel;
80
- /**
81
- * A list of request origins used to inject tracing headers, to be able to connect RUM and backend tracing.
82
- */
83
- allowedTracingOrigins?: (string | RegExp)[];
84
- }
85
- export declare function datadogReporter(info: ServiceInfo, config: DatadogReporterConfig): IReporter;
1
+ import { IReporter, ServiceInfo, ReporterConfigBase } from '../types';
2
+ import { LogsInitConfiguration } from '@datadog/browser-logs';
3
+ import { DefaultPrivacyLevel, RumInitConfiguration } from '@datadog/browser-rum';
4
+ import { DatadogLogTransportConfig } from '../logger/datadogTransport';
5
+ export interface DatadogReporterConfig extends ReporterConfigBase {
6
+ /** The RUM application ID. */
7
+ applicationId: string;
8
+ /** A Datadog client token (Generated in the RUM Page) */
9
+ clientToken: string;
10
+ /** The Datadog site parameter of your organization. */
11
+ site: string;
12
+ /** The Application's version (Overrides the browser logger version) */
13
+ version?: string;
14
+ /** Optional proxy URL */
15
+ proxyUrl?: string;
16
+ /**
17
+ * Controls the percentage of overall sessions being tracked. It defaults to 100, so every session is tracked by default.
18
+ */
19
+ sampleRate?: number;
20
+ /**
21
+ * Applied after the overall sample rate, and controls the percentage of sessions tracked as Browser RUM & Session Replay.
22
+ * It defaults to 100, so every session is tracked as Browser RUM & Session Replay by default.
23
+ */
24
+ replaySampleRate?: number;
25
+ /**
26
+ * Use a secure session cookie. This disables RUM events sent on insecure (non-HTTPS) connections.
27
+ */
28
+ useSecureSessionCookie?: boolean;
29
+ /**
30
+ * Use a secure cross-site session cookie.
31
+ * This allows the RUM Browser SDK to run when the site is loaded from another one (iframe). Implies `useSecureSessionCookie`
32
+ */
33
+ useCrossSiteSessionCookie?: boolean;
34
+ /**
35
+ * Preserve the session across subdomains for the same site.
36
+ */
37
+ trackSessionAcrossSubdomains?: boolean;
38
+ /**
39
+ * Forward console.error logs, uncaught exceptions and network errors to Datadog.
40
+ * Defaults to false.
41
+ */
42
+ forwardConsoleLogs?: boolean;
43
+ /**
44
+ * Enables automatic collection of users actions.
45
+ */
46
+ trackInteractions?: boolean;
47
+ /**
48
+ * Enables automatic collection of user frustrations. Implies `trackInteractions`: true.
49
+ */
50
+ trackFrustrations?: boolean;
51
+ /**
52
+ * Allows you to control RUM views creation.
53
+ * You will need to call `Logger.setPageName()` to create a new view.
54
+ */
55
+ trackViewsManually?: boolean;
56
+ /**
57
+ * Specify your own attribute to be used to name actions.
58
+ * Defaults to `data-analytics-name` to coincide with analytics attributes used across reporters.
59
+ */
60
+ actionNameAttribute?: string;
61
+ /**
62
+ * Allows you to modify RUM events before they are sent to Datadog.
63
+ */
64
+ beforeSend?: RumInitConfiguration['beforeSend'];
65
+ /**
66
+ * Toggles/configures the Datadog Log Transport.
67
+ * Defaults to true.
68
+ */
69
+ logTransport?: boolean | DatadogLogTransportConfig;
70
+ /**
71
+ * Allows you to modify Log events before they are sent to Datadog (Can only be set at ).
72
+ */
73
+ beforeLogsSend?: LogsInitConfiguration['beforeSend'];
74
+ /**
75
+ * By enabling Session Replay, you can automatically mask sensitive elements from being recorded through the RUM Browser SDK.
76
+ *
77
+ * See https://docs.datadoghq.com/real_user_monitoring/session_replay/privacy_options
78
+ */
79
+ defaultPrivacyLevel?: DefaultPrivacyLevel;
80
+ /**
81
+ * A list of request origins used to inject tracing headers, to be able to connect RUM and backend tracing.
82
+ */
83
+ allowedTracingOrigins?: (string | RegExp)[];
84
+ }
85
+ export declare function datadogReporter(info: ServiceInfo, config: DatadogReporterConfig): IReporter;
86
86
  //# sourceMappingURL=datadogReporter.d.ts.map
@@ -1,125 +1,125 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.datadogReporter = void 0;
4
- const browser_logs_1 = require("@datadog/browser-logs");
5
- const browser_rum_1 = require("@datadog/browser-rum");
6
- const logger_1 = require("../logger");
7
- const datadogTransport_1 = require("../logger/datadogTransport");
8
- function datadogReporter(info, config) {
9
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
10
- const isLocalhost = window.location.hostname === 'localhost';
11
- // Don't forward error logs by default, do enable the log transport by default
12
- // forwardErrorsToLogs incorrectly is called forwardConsoleLogs, this is for backwards compatibility
13
- const forwardErrorsToLogs = (_a = config.forwardConsoleLogs) !== null && _a !== void 0 ? _a : false;
14
- const enableLogTransport = config.logTransport !== false;
15
- // Only init datadog logs if something is using it.
16
- if (forwardErrorsToLogs !== true && enableLogTransport !== true) {
17
- browser_logs_1.datadogLogs.init({
18
- site: config.site,
19
- proxyUrl: config.proxyUrl,
20
- clientToken: config.clientToken,
21
- service: info.service,
22
- env: info.environment,
23
- version: (_b = config.version) !== null && _b !== void 0 ? _b : info.version,
24
- sampleRate: (_c = config.sampleRate) !== null && _c !== void 0 ? _c : 100,
25
- beforeSend: config.beforeLogsSend,
26
- useSecureSessionCookie: (_d = config.useSecureSessionCookie) !== null && _d !== void 0 ? _d : !isLocalhost,
27
- useCrossSiteSessionCookie: (_e = config.useCrossSiteSessionCookie) !== null && _e !== void 0 ? _e : false,
28
- trackSessionAcrossSubdomains: config.trackSessionAcrossSubdomains,
29
- forwardErrorsToLogs,
30
- });
31
- browser_logs_1.datadogLogs.logger.setHandler(browser_logs_1.HandlerType.http);
32
- }
33
- // Add the datadog log transport
34
- if (enableLogTransport) {
35
- logger_1.logTransports.push((0, datadogTransport_1.datadogTransport)(typeof config.logTransport === 'boolean' ? {} : config.logTransport));
36
- }
37
- browser_rum_1.datadogRum.init({
38
- site: config.site,
39
- proxyUrl: config.proxyUrl,
40
- clientToken: config.clientToken,
41
- applicationId: config.applicationId,
42
- service: info.service,
43
- env: info.environment,
44
- version: (_f = config.version) !== null && _f !== void 0 ? _f : info.version,
45
- sampleRate: (_g = config.sampleRate) !== null && _g !== void 0 ? _g : 100,
46
- replaySampleRate: (_h = config.replaySampleRate) !== null && _h !== void 0 ? _h : 100,
47
- useSecureSessionCookie: (_j = config.useSecureSessionCookie) !== null && _j !== void 0 ? _j : !isLocalhost,
48
- useCrossSiteSessionCookie: (_k = config.useCrossSiteSessionCookie) !== null && _k !== void 0 ? _k : false,
49
- trackSessionAcrossSubdomains: config.trackSessionAcrossSubdomains,
50
- trackInteractions: (_l = config.trackInteractions) !== null && _l !== void 0 ? _l : false,
51
- trackFrustrations: (_m = config.trackFrustrations) !== null && _m !== void 0 ? _m : false,
52
- trackViewsManually: (_o = config.trackViewsManually) !== null && _o !== void 0 ? _o : false,
53
- actionNameAttribute: (_p = config.actionNameAttribute) !== null && _p !== void 0 ? _p : 'data-analytics-name',
54
- beforeSend: config.beforeSend,
55
- defaultPrivacyLevel: (_q = config.defaultPrivacyLevel) !== null && _q !== void 0 ? _q : 'mask-user-input',
56
- allowedTracingOrigins: config.allowedTracingOrigins,
57
- });
58
- const reporter = {
59
- trackEvent: function (event) {
60
- browser_rum_1.datadogRum.addAction(event.message, {
61
- level: event.level,
62
- ...event.metadata,
63
- ...event.tags,
64
- ...event.metrics,
65
- });
66
- },
67
- addBreadcrumb: function (breadcrumb) {
68
- browser_rum_1.datadogRum.addAction(breadcrumb.message, {
69
- ...breadcrumb.metadata,
70
- category: breadcrumb.category,
71
- });
72
- },
73
- addMetadata: function (metadata) {
74
- for (const [key, value] of Object.entries(metadata)) {
75
- if (value !== null) {
76
- browser_rum_1.datadogRum.addRumGlobalContext(key, value);
77
- // Note, this will add duplicate context data in logs.
78
- // But this is valuable for logs ingested outside of the browser logger.
79
- browser_logs_1.datadogLogs.addLoggerGlobalContext(key, value);
80
- }
81
- else {
82
- browser_rum_1.datadogRum.removeRumGlobalContext(key);
83
- // But this is valuable for logs ingested outside of the browser logger.
84
- browser_logs_1.datadogLogs.removeLoggerGlobalContext(key);
85
- }
86
- }
87
- },
88
- setUser: function (user) {
89
- var _a;
90
- if (user) {
91
- browser_rum_1.datadogRum.setUser({
92
- id: user.id,
93
- email: user.email,
94
- name: (_a = user.name) !== null && _a !== void 0 ? _a : user.email,
95
- });
96
- }
97
- else {
98
- browser_rum_1.datadogRum.removeUser();
99
- }
100
- },
101
- setRouteName: function (routeName) {
102
- reporter.addMetadata({ routeName });
103
- },
104
- setPageName: function (pageName) {
105
- if (config.trackViewsManually) {
106
- browser_rum_1.datadogRum.startView(pageName);
107
- }
108
- else {
109
- reporter.addMetadata({ pageName });
110
- }
111
- },
112
- reportError: function (error, metadata) {
113
- browser_rum_1.datadogRum.addError(error, metadata);
114
- },
115
- recordSession: function () {
116
- browser_rum_1.datadogRum.startSessionReplayRecording();
117
- },
118
- recordSessionStop: function () {
119
- browser_rum_1.datadogRum.stopSessionReplayRecording();
120
- },
121
- };
122
- return reporter;
123
- }
124
- exports.datadogReporter = datadogReporter;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.datadogReporter = void 0;
4
+ const browser_logs_1 = require("@datadog/browser-logs");
5
+ const browser_rum_1 = require("@datadog/browser-rum");
6
+ const logger_1 = require("../logger");
7
+ const datadogTransport_1 = require("../logger/datadogTransport");
8
+ function datadogReporter(info, config) {
9
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
10
+ const isLocalhost = window.location.hostname === 'localhost';
11
+ // Don't forward error logs by default, do enable the log transport by default
12
+ // forwardErrorsToLogs incorrectly is called forwardConsoleLogs, this is for backwards compatibility
13
+ const forwardErrorsToLogs = (_a = config.forwardConsoleLogs) !== null && _a !== void 0 ? _a : false;
14
+ const enableLogTransport = config.logTransport !== false;
15
+ // Only init datadog logs if something is using it.
16
+ if (forwardErrorsToLogs !== true && enableLogTransport !== true) {
17
+ browser_logs_1.datadogLogs.init({
18
+ site: config.site,
19
+ proxyUrl: config.proxyUrl,
20
+ clientToken: config.clientToken,
21
+ service: info.service,
22
+ env: info.environment,
23
+ version: (_b = config.version) !== null && _b !== void 0 ? _b : info.version,
24
+ sampleRate: (_c = config.sampleRate) !== null && _c !== void 0 ? _c : 100,
25
+ beforeSend: config.beforeLogsSend,
26
+ useSecureSessionCookie: (_d = config.useSecureSessionCookie) !== null && _d !== void 0 ? _d : !isLocalhost,
27
+ useCrossSiteSessionCookie: (_e = config.useCrossSiteSessionCookie) !== null && _e !== void 0 ? _e : false,
28
+ trackSessionAcrossSubdomains: config.trackSessionAcrossSubdomains,
29
+ forwardErrorsToLogs,
30
+ });
31
+ browser_logs_1.datadogLogs.logger.setHandler(browser_logs_1.HandlerType.http);
32
+ }
33
+ // Add the datadog log transport
34
+ if (enableLogTransport) {
35
+ logger_1.logTransports.push((0, datadogTransport_1.datadogTransport)(typeof config.logTransport === 'boolean' ? {} : config.logTransport));
36
+ }
37
+ browser_rum_1.datadogRum.init({
38
+ site: config.site,
39
+ proxyUrl: config.proxyUrl,
40
+ clientToken: config.clientToken,
41
+ applicationId: config.applicationId,
42
+ service: info.service,
43
+ env: info.environment,
44
+ version: (_f = config.version) !== null && _f !== void 0 ? _f : info.version,
45
+ sampleRate: (_g = config.sampleRate) !== null && _g !== void 0 ? _g : 100,
46
+ replaySampleRate: (_h = config.replaySampleRate) !== null && _h !== void 0 ? _h : 100,
47
+ useSecureSessionCookie: (_j = config.useSecureSessionCookie) !== null && _j !== void 0 ? _j : !isLocalhost,
48
+ useCrossSiteSessionCookie: (_k = config.useCrossSiteSessionCookie) !== null && _k !== void 0 ? _k : false,
49
+ trackSessionAcrossSubdomains: config.trackSessionAcrossSubdomains,
50
+ trackInteractions: (_l = config.trackInteractions) !== null && _l !== void 0 ? _l : false,
51
+ trackFrustrations: (_m = config.trackFrustrations) !== null && _m !== void 0 ? _m : false,
52
+ trackViewsManually: (_o = config.trackViewsManually) !== null && _o !== void 0 ? _o : false,
53
+ actionNameAttribute: (_p = config.actionNameAttribute) !== null && _p !== void 0 ? _p : 'data-analytics-name',
54
+ beforeSend: config.beforeSend,
55
+ defaultPrivacyLevel: (_q = config.defaultPrivacyLevel) !== null && _q !== void 0 ? _q : 'mask-user-input',
56
+ allowedTracingOrigins: config.allowedTracingOrigins,
57
+ });
58
+ const reporter = {
59
+ trackEvent: function (event) {
60
+ browser_rum_1.datadogRum.addAction(event.message, {
61
+ level: event.level,
62
+ ...event.metadata,
63
+ ...event.tags,
64
+ ...event.metrics,
65
+ });
66
+ },
67
+ addBreadcrumb: function (breadcrumb) {
68
+ browser_rum_1.datadogRum.addAction(breadcrumb.message, {
69
+ ...breadcrumb.metadata,
70
+ category: breadcrumb.category,
71
+ });
72
+ },
73
+ addMetadata: function (metadata) {
74
+ for (const [key, value] of Object.entries(metadata)) {
75
+ if (value !== null) {
76
+ browser_rum_1.datadogRum.addRumGlobalContext(key, value);
77
+ // Note, this will add duplicate context data in logs.
78
+ // But this is valuable for logs ingested outside of the browser logger.
79
+ browser_logs_1.datadogLogs.addLoggerGlobalContext(key, value);
80
+ }
81
+ else {
82
+ browser_rum_1.datadogRum.removeRumGlobalContext(key);
83
+ // But this is valuable for logs ingested outside of the browser logger.
84
+ browser_logs_1.datadogLogs.removeLoggerGlobalContext(key);
85
+ }
86
+ }
87
+ },
88
+ setUser: function (user) {
89
+ var _a;
90
+ if (user) {
91
+ browser_rum_1.datadogRum.setUser({
92
+ id: user.id,
93
+ email: user.email,
94
+ name: (_a = user.name) !== null && _a !== void 0 ? _a : user.email,
95
+ });
96
+ }
97
+ else {
98
+ browser_rum_1.datadogRum.removeUser();
99
+ }
100
+ },
101
+ setRouteName: function (routeName) {
102
+ reporter.addMetadata({ routeName });
103
+ },
104
+ setPageName: function (pageName) {
105
+ if (config.trackViewsManually) {
106
+ browser_rum_1.datadogRum.startView(pageName);
107
+ }
108
+ else {
109
+ reporter.addMetadata({ pageName });
110
+ }
111
+ },
112
+ reportError: function (error, metadata) {
113
+ browser_rum_1.datadogRum.addError(error, metadata);
114
+ },
115
+ recordSession: function () {
116
+ browser_rum_1.datadogRum.startSessionReplayRecording();
117
+ },
118
+ recordSessionStop: function () {
119
+ browser_rum_1.datadogRum.stopSessionReplayRecording();
120
+ },
121
+ };
122
+ return reporter;
123
+ }
124
+ exports.datadogReporter = datadogReporter;
125
125
  //# sourceMappingURL=datadogReporter.js.map
@@ -1,9 +1,9 @@
1
- import { IReporter, ServiceInfo, ReporterConfigBase } from '../types';
2
- export declare type GTMReporterConfig = ReporterConfigBase;
3
- declare global {
4
- interface Window {
5
- dataLayer?: Record<string, any>[];
6
- }
7
- }
8
- export declare function gtmReporter(info: ServiceInfo, config: GTMReporterConfig): IReporter;
1
+ import { IReporter, ServiceInfo, ReporterConfigBase } from '../types';
2
+ export declare type GTMReporterConfig = ReporterConfigBase;
3
+ declare global {
4
+ interface Window {
5
+ dataLayer?: Record<string, any>[];
6
+ }
7
+ }
8
+ export declare function gtmReporter(info: ServiceInfo, config: GTMReporterConfig): IReporter;
9
9
  //# sourceMappingURL=gtmReporter.d.ts.map