@sentry/browser 10.11.0 → 10.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/build/npm/cjs/index.js +4 -2
  2. package/build/npm/cjs/index.js.map +1 -1
  3. package/build/npm/cjs/tracing/browserTracingIntegration.js +48 -7
  4. package/build/npm/cjs/tracing/browserTracingIntegration.js.map +1 -1
  5. package/build/npm/cjs/tracing/reportPageLoaded.js +18 -0
  6. package/build/npm/cjs/tracing/reportPageLoaded.js.map +1 -0
  7. package/build/npm/cjs/tracing/request.js +1 -3
  8. package/build/npm/cjs/tracing/request.js.map +1 -1
  9. package/build/npm/cjs/transports/fetch.js +13 -19
  10. package/build/npm/cjs/transports/fetch.js.map +1 -1
  11. package/build/npm/esm/index.js +2 -3
  12. package/build/npm/esm/index.js.map +1 -1
  13. package/build/npm/esm/package.json +1 -1
  14. package/build/npm/esm/tracing/browserTracingIntegration.js +49 -8
  15. package/build/npm/esm/tracing/browserTracingIntegration.js.map +1 -1
  16. package/build/npm/esm/tracing/reportPageLoaded.js +16 -0
  17. package/build/npm/esm/tracing/reportPageLoaded.js.map +1 -0
  18. package/build/npm/esm/tracing/request.js +2 -4
  19. package/build/npm/esm/tracing/request.js.map +1 -1
  20. package/build/npm/esm/transports/fetch.js +14 -20
  21. package/build/npm/esm/transports/fetch.js.map +1 -1
  22. package/build/npm/types/index.bundle.tracing.d.ts +1 -0
  23. package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
  24. package/build/npm/types/index.bundle.tracing.replay.d.ts +1 -0
  25. package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
  26. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +1 -0
  27. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
  28. package/build/npm/types/index.d.ts +3 -4
  29. package/build/npm/types/index.d.ts.map +1 -1
  30. package/build/npm/types/tracing/browserTracingIntegration.d.ts +17 -1
  31. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  32. package/build/npm/types/tracing/reportPageLoaded.d.ts +11 -0
  33. package/build/npm/types/tracing/reportPageLoaded.d.ts.map +1 -0
  34. package/build/npm/types/tracing/request.d.ts.map +1 -1
  35. package/build/npm/types/transports/fetch.d.ts +1 -1
  36. package/build/npm/types/transports/fetch.d.ts.map +1 -1
  37. package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -0
  38. package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -0
  39. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -0
  40. package/build/npm/types-ts3.8/index.d.ts +3 -4
  41. package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +17 -1
  42. package/build/npm/types-ts3.8/tracing/reportPageLoaded.d.ts +11 -0
  43. package/build/npm/types-ts3.8/transports/fetch.d.ts +1 -1
  44. package/package.json +7 -7
  45. package/build/npm/cjs/log.js +0 -213
  46. package/build/npm/cjs/log.js.map +0 -1
  47. package/build/npm/cjs/tracing/resource-timing.js +0 -45
  48. package/build/npm/cjs/tracing/resource-timing.js.map +0 -1
  49. package/build/npm/esm/log.js +0 -206
  50. package/build/npm/esm/log.js.map +0 -1
  51. package/build/npm/esm/tracing/resource-timing.js +0 -43
  52. package/build/npm/esm/tracing/resource-timing.js.map +0 -1
  53. package/build/npm/types/log.d.ts +0 -169
  54. package/build/npm/types/log.d.ts.map +0 -1
  55. package/build/npm/types/tracing/resource-timing.d.ts +0 -9
  56. package/build/npm/types/tracing/resource-timing.d.ts.map +0 -1
  57. package/build/npm/types-ts3.8/log.d.ts +0 -169
  58. package/build/npm/types-ts3.8/tracing/resource-timing.d.ts +0 -9
@@ -1,4 +1,4 @@
1
- import { createTransport, rejectedSyncPromise } from '@sentry/core';
1
+ import { createTransport } from '@sentry/core';
2
2
  import { getNativeImplementation, clearCachedImplementation } from '@sentry-internal/browser-utils';
3
3
 
4
4
  /**
@@ -11,7 +11,7 @@ function makeFetchTransport(
11
11
  let pendingBodySize = 0;
12
12
  let pendingCount = 0;
13
13
 
14
- function makeRequest(request) {
14
+ async function makeRequest(request) {
15
15
  const requestSize = request.body.length;
16
16
  pendingBodySize += requestSize;
17
17
  pendingCount++;
@@ -36,29 +36,23 @@ function makeFetchTransport(
36
36
  ...options.fetchOptions,
37
37
  };
38
38
 
39
- if (!nativeFetch) {
40
- clearCachedImplementation('fetch');
41
- return rejectedSyncPromise('No fetch implementation available');
42
- }
43
-
44
39
  try {
45
- // Note: We do not need to suppress tracing here, becasue we are using the native fetch, instead of our wrapped one.
46
- return nativeFetch(options.url, requestOptions).then(response => {
47
- pendingBodySize -= requestSize;
48
- pendingCount--;
49
- return {
50
- statusCode: response.status,
51
- headers: {
52
- 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
53
- 'retry-after': response.headers.get('Retry-After'),
54
- },
55
- };
56
- });
40
+ // Note: We do not need to suppress tracing here, because we are using the native fetch, instead of our wrapped one.
41
+ const response = await nativeFetch(options.url, requestOptions);
42
+
43
+ return {
44
+ statusCode: response.status,
45
+ headers: {
46
+ 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
47
+ 'retry-after': response.headers.get('Retry-After'),
48
+ },
49
+ };
57
50
  } catch (e) {
58
51
  clearCachedImplementation('fetch');
52
+ throw e;
53
+ } finally {
59
54
  pendingBodySize -= requestSize;
60
55
  pendingCount--;
61
- return rejectedSyncPromise(e);
62
56
  }
63
57
  }
64
58
 
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sources":["../../../../src/transports/fetch.ts"],"sourcesContent":["import type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/core';\nimport { createTransport, rejectedSyncPromise } from '@sentry/core';\nimport { clearCachedImplementation, getNativeImplementation } from '@sentry-internal/browser-utils';\nimport type { WINDOW } from '../helpers';\nimport type { BrowserTransportOptions } from './types';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeFetchTransport(\n options: BrowserTransportOptions,\n nativeFetch: typeof WINDOW.fetch | undefined = getNativeImplementation('fetch'),\n): Transport {\n let pendingBodySize = 0;\n let pendingCount = 0;\n\n function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n const requestSize = request.body.length;\n pendingBodySize += requestSize;\n pendingCount++;\n\n const requestOptions: RequestInit = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'strict-origin',\n headers: options.headers,\n // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n // frequently sending events right before the user is switching pages (eg. when finishing navigation transactions).\n // Gotchas:\n // - `keepalive` isn't supported by Firefox\n // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n // We will therefore only activate the flag when we're below that limit.\n // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n keepalive: pendingBodySize <= 60_000 && pendingCount < 15,\n ...options.fetchOptions,\n };\n\n if (!nativeFetch) {\n clearCachedImplementation('fetch');\n return rejectedSyncPromise('No fetch implementation available');\n }\n\n try {\n // Note: We do not need to suppress tracing here, becasue we are using the native fetch, instead of our wrapped one.\n return nativeFetch(options.url, requestOptions).then(response => {\n pendingBodySize -= requestSize;\n pendingCount--;\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n });\n } catch (e) {\n clearCachedImplementation('fetch');\n pendingBodySize -= requestSize;\n pendingCount--;\n return rejectedSyncPromise(e);\n }\n }\n\n return createTransport(options, makeRequest);\n}\n"],"names":[],"mappings":";;;AAMA;AACA;AACA;AACO,SAAS,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,OAAO,CAAC;AACR,KAAI,CAAE,OAAO,CAAC,EAAE;AAChB,MAAM,yBAAyB,CAAC,OAAO,CAAC;AACxC,MAAM,eAAA,IAAmB,WAAW;AACpC,MAAM,YAAY,EAAE;AACpB,MAAM,OAAO,mBAAmB,CAAC,CAAC,CAAC;AACnC;AACA;;AAEA,EAAE,OAAO,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC;AAC9C;;;;"}
1
+ {"version":3,"file":"fetch.js","sources":["../../../../src/transports/fetch.ts"],"sourcesContent":["import type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/core';\nimport { createTransport } from '@sentry/core';\nimport { clearCachedImplementation, getNativeImplementation } from '@sentry-internal/browser-utils';\nimport type { WINDOW } from '../helpers';\nimport type { BrowserTransportOptions } from './types';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeFetchTransport(\n options: BrowserTransportOptions,\n nativeFetch: typeof WINDOW.fetch = getNativeImplementation('fetch'),\n): Transport {\n let pendingBodySize = 0;\n let pendingCount = 0;\n\n async function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n const requestSize = request.body.length;\n pendingBodySize += requestSize;\n pendingCount++;\n\n const requestOptions: RequestInit = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'strict-origin',\n headers: options.headers,\n // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n // frequently sending events right before the user is switching pages (eg. when finishing navigation transactions).\n // Gotchas:\n // - `keepalive` isn't supported by Firefox\n // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n // We will therefore only activate the flag when we're below that limit.\n // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n keepalive: pendingBodySize <= 60_000 && pendingCount < 15,\n ...options.fetchOptions,\n };\n\n try {\n // Note: We do not need to suppress tracing here, because we are using the native fetch, instead of our wrapped one.\n const response = await nativeFetch(options.url, requestOptions);\n\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n } catch (e) {\n clearCachedImplementation('fetch');\n throw e;\n } finally {\n pendingBodySize -= requestSize;\n pendingCount--;\n }\n }\n\n return createTransport(options, makeRequest);\n}\n"],"names":[],"mappings":";;;AAMA;AACA;AACA;AACO,SAAS,kBAAkB;AAClC,EAAE,OAAO;AACT,EAAE,WAAW,GAAwB,uBAAuB,CAAC,OAAO,CAAC;AACrE,EAAa;AACb,EAAE,IAAI,eAAA,GAAkB,CAAC;AACzB,EAAE,IAAI,YAAA,GAAe,CAAC;;AAEtB,EAAE,eAAe,WAAW,CAAC,OAAO,EAA2D;AAC/F,IAAI,MAAM,WAAA,GAAc,OAAO,CAAC,IAAI,CAAC,MAAM;AAC3C,IAAI,eAAA,IAAmB,WAAW;AAClC,IAAI,YAAY,EAAE;;AAElB,IAAI,MAAM,cAAc,GAAgB;AACxC,MAAM,IAAI,EAAE,OAAO,CAAC,IAAI;AACxB,MAAM,MAAM,EAAE,MAAM;AACpB,MAAM,cAAc,EAAE,eAAe;AACrC,MAAM,OAAO,EAAE,OAAO,CAAC,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,EAAE,eAAA,IAAmB,SAAU,YAAA,GAAe,EAAE;AAC/D,MAAM,GAAG,OAAO,CAAC,YAAY;AAC7B,KAAK;;AAEL,IAAI,IAAI;AACR;AACA,MAAM,MAAM,QAAA,GAAW,MAAM,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC;;AAErE,MAAM,OAAO;AACb,QAAQ,UAAU,EAAE,QAAQ,CAAC,MAAM;AACnC,QAAQ,OAAO,EAAE;AACjB,UAAU,sBAAsB,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;AAC9E,UAAU,aAAa,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AAC5D,SAAS;AACT,OAAO;AACP,KAAI,CAAE,OAAO,CAAC,EAAE;AAChB,MAAM,yBAAyB,CAAC,OAAO,CAAC;AACxC,MAAM,MAAM,CAAC;AACb,cAAc;AACd,MAAM,eAAA,IAAmB,WAAW;AACpC,MAAM,YAAY,EAAE;AACpB;AACA;;AAEA,EAAE,OAAO,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC;AAC9C;;;;"}
@@ -2,5 +2,6 @@ import { feedbackIntegrationShim, replayIntegrationShim } from '@sentry-internal
2
2
  export * from './index.bundle.base';
3
3
  export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core';
4
4
  export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration';
5
+ export { reportPageLoaded } from './tracing/reportPageLoaded';
5
6
  export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration, replayIntegrationShim as replayIntegration, };
6
7
  //# sourceMappingURL=index.bundle.tracing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.bundle.tracing.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAIpG,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EACL,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,uBAAuB,IAAI,wBAAwB,EACnD,uBAAuB,IAAI,mBAAmB,EAC9C,qBAAqB,IAAI,iBAAiB,GAC3C,CAAC"}
1
+ {"version":3,"file":"index.bundle.tracing.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAIpG,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EACL,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EACL,uBAAuB,IAAI,wBAAwB,EACnD,uBAAuB,IAAI,mBAAmB,EAC9C,qBAAqB,IAAI,iBAAiB,GAC3C,CAAC"}
@@ -2,6 +2,7 @@ import { feedbackIntegrationShim } from '@sentry-internal/integration-shims';
2
2
  export * from './index.bundle.base';
3
3
  export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core';
4
4
  export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration';
5
+ export { reportPageLoaded } from './tracing/reportPageLoaded';
5
6
  export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration };
6
7
  export { replayIntegration, getReplay } from '@sentry-internal/replay';
7
8
  //# sourceMappingURL=index.bundle.tracing.replay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.bundle.tracing.replay.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.replay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EACL,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,uBAAuB,IAAI,wBAAwB,EAAE,uBAAuB,IAAI,mBAAmB,EAAE,CAAC;AAE/G,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.bundle.tracing.replay.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.replay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EACL,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,uBAAuB,IAAI,wBAAwB,EAAE,uBAAuB,IAAI,mBAAmB,EAAE,CAAC;AAE/G,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC"}
@@ -2,6 +2,7 @@ import { feedbackAsyncIntegration } from './feedbackAsync';
2
2
  export * from './index.bundle.base';
3
3
  export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core';
4
4
  export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration';
5
+ export { reportPageLoaded } from './tracing/reportPageLoaded';
5
6
  export { getFeedback, sendFeedback } from '@sentry-internal/feedback';
6
7
  export { feedbackAsyncIntegration as feedbackAsyncIntegration, feedbackAsyncIntegration as feedbackIntegration };
7
8
  export { replayIntegration, getReplay } from '@sentry-internal/replay';
@@ -1 +1 @@
1
- {"version":3,"file":"index.bundle.tracing.replay.feedback.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.replay.feedback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAI3D,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EACL,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,wBAAwB,IAAI,wBAAwB,EAAE,wBAAwB,IAAI,mBAAmB,EAAE,CAAC;AAEjH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.bundle.tracing.replay.feedback.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.replay.feedback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAI3D,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EACL,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,wBAAwB,IAAI,wBAAwB,EAAE,wBAAwB,IAAI,mBAAmB,EAAE,CAAC;AAEjH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,13 +1,11 @@
1
1
  import { feedbackAsyncIntegration } from './feedbackAsync';
2
2
  import { feedbackSyncIntegration } from './feedbackSync';
3
- import * as logger from './log';
4
3
  export * from './exports';
5
- export { logger };
6
4
  export { reportingObserverIntegration } from './integrations/reportingobserver';
7
5
  export { httpClientIntegration } from './integrations/httpclient';
8
6
  export { contextLinesIntegration } from './integrations/contextlines';
9
7
  export { graphqlClientIntegration } from './integrations/graphqlClient';
10
- export { captureConsoleIntegration, extraErrorDataIntegration, rewriteFramesIntegration, consoleLoggingIntegration, } from '@sentry/core';
8
+ export { captureConsoleIntegration, extraErrorDataIntegration, rewriteFramesIntegration, consoleLoggingIntegration, createConsolaReporter, } from '@sentry/core';
11
9
  export { replayIntegration, getReplay } from '@sentry-internal/replay';
12
10
  export type { ReplayEventType, ReplayEventWithTime, ReplayBreadcrumbFrame, ReplayBreadcrumbFrameEvent, ReplayOptionFrameEvent, ReplayFrame, ReplayFrameEvent, ReplaySpanFrame, ReplaySpanFrameEvent, } from '@sentry-internal/replay';
13
11
  export { replayCanvasIntegration } from '@sentry-internal/replay-canvas';
@@ -15,8 +13,9 @@ export { feedbackAsyncIntegration, feedbackSyncIntegration, feedbackSyncIntegrat
15
13
  export { getFeedback, sendFeedback } from '@sentry-internal/feedback';
16
14
  export { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './tracing/request';
17
15
  export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration';
16
+ export { reportPageLoaded } from './tracing/reportPageLoaded';
18
17
  export type { RequestInstrumentationOptions } from './tracing/request';
19
- export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, } from '@sentry/core';
18
+ export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, logger, } from '@sentry/core';
20
19
  export type { Span, FeatureFlagsIntegration } from '@sentry/core';
21
20
  export { makeBrowserOfflineTransport } from './transports/offline';
22
21
  export { browserProfilingIntegration } from './profiling/integration';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,OAAO,CAAC;AAEhC,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,uB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AAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -180,6 +180,22 @@ export interface BrowserTracingOptions {
180
180
  * @default `false` - this is an opt-in feature.
181
181
  */
182
182
  consistentTraceSampling: boolean;
183
+ /**
184
+ * If set to `true`, the pageload span will not end itself automatically, unless it
185
+ * runs until the {@link BrowserTracingOptions.finalTimeout} (30 seconds by default) is reached.
186
+ *
187
+ * Set this option to `true`, if you want full control over the pageload span duration.
188
+ * You can use `Sentry.reportPageLoaded()` to manually end the pageload span whenever convenient.
189
+ * Be aware that you have to ensure that this is always called, regardless of the chosen route
190
+ * or path in the application.
191
+ *
192
+ * @default `false`. By default, the pageload span will end itself automatically, based on
193
+ * the {@link BrowserTracingOptions.finalTimeout}, {@link BrowserTracingOptions.idleTimeout}
194
+ * and {@link BrowserTracingOptions.childSpanTimeout}. This is more convenient to use but means
195
+ * that the pageload duration can be arbitrary and might not be fully representative of a perceived
196
+ * page load time.
197
+ */
198
+ enableReportPageLoaded: boolean;
183
199
  /**
184
200
  * _experiments allows the user to send options to define how this integration works.
185
201
  *
@@ -220,7 +236,7 @@ export interface BrowserTracingOptions {
220
236
  *
221
237
  * We explicitly export the proper type here, as this has to be extended in some cases.
222
238
  */
223
- export declare const browserTracingIntegration: (_options?: Partial<BrowserTracingOptions>) => {
239
+ export declare const browserTracingIntegration: (options?: Partial<BrowserTracingOptions>) => {
224
240
  name: string;
225
241
  setup(client: Client<import("@sentry/core").ClientOptions<import("@sentry/core").BaseTransportOptions>>): void;
226
242
  afterAllSetup(client: Client<import("@sentry/core").ClientOptions<import("@sentry/core").BaseTransportOptions>>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"browserTracingIntegration.d.ts","sourceRoot":"","sources":["../../../../src/tracing/browserTracingIntegration.ts"],"names":[],"mappings":"AACA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AAsC;AACtC,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASnE"}
@@ -0,0 +1,11 @@
1
+ import type { Client } from '@sentry/core';
2
+ /**
3
+ * Manually report the end of the page load, resulting in the SDK ending the pageload span.
4
+ * This only works if {@link BrowserTracingOptions.enableReportPageLoaded} is set to `true`.
5
+ * Otherwise, the pageload span will end itself based on the {@link BrowserTracingOptions.finalTimeout},
6
+ * {@link BrowserTracingOptions.idleTimeout} and {@link BrowserTracingOptions.childSpanTimeout}.
7
+ *
8
+ * @param client - The client to use. If not provided, the global client will be used.
9
+ */
10
+ export declare function reportPageLoaded(client?: Client | undefined): void;
11
+ //# sourceMappingURL=reportPageLoaded.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportPageLoaded.d.ts","sourceRoot":"","sources":["../../../../src/tracing/reportPageLoaded.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,MAAM,GAAG,SAAuB,GAAG,IAAI,CAE/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../src/tracing/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAA+C,IAAI,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA8B/G,0CAA0C;AAC1C,MAAM,WAAW,6BAA6B;IAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,uBAAuB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEjD;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;;;;OAQG;IACH,2BAA2B,EAAE,OAAO,CAAC;IAErC;;;;OAIG;IACH,iBAAiB,EAAE,OAAO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,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE;QAAE,OAAO,CAAC,EAAE,eAAe,CAAA;KAAE,GAAG,IAAI,CAAC;CAC1F;AAKD,eAAO,MAAM,oCAAoC,EAAE,6BAKlD,CAAC;AAEF,0DAA0D;AAC1D,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,GAAG,IAAI,CA0GlH;AAoCD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,uBAAuB,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,GACvD,OAAO,CAqCT"}
@@ -4,5 +4,5 @@ import type { BrowserTransportOptions } from './types';
4
4
  /**
5
5
  * Creates a Transport that uses the Fetch API to send events to Sentry.
6
6
  */
7
- export declare function makeFetchTransport(options: BrowserTransportOptions, nativeFetch?: typeof WINDOW.fetch | undefined): Transport;
7
+ export declare function makeFetchTransport(options: BrowserTransportOptions, nativeFetch?: typeof WINDOW.fetch): Transport;
8
8
  //# sourceMappingURL=fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/transports/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkD,MAAM,cAAc,CAAC;AAG9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,uBAAuB,EAChC,WAAW,GAAE,OAAO,MAAM,CAAC,KAAK,GAAG,SAA4C,GAC9E,SAAS,CAwDX"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/transports/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkD,MAAM,cAAc,CAAC;AAG9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,uBAAuB,EAChC,WAAW,GAAE,OAAO,MAAM,CAAC,KAAwC,GAClE,SAAS,CAkDX"}
@@ -2,5 +2,6 @@ import { feedbackIntegrationShim, replayIntegrationShim } from '@sentry-internal
2
2
  export * from './index.bundle.base';
3
3
  export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core';
4
4
  export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration';
5
+ export { reportPageLoaded } from './tracing/reportPageLoaded';
5
6
  export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration, replayIntegrationShim as replayIntegration, };
6
7
  //# sourceMappingURL=index.bundle.tracing.d.ts.map
@@ -2,6 +2,7 @@ import { feedbackIntegrationShim } from '@sentry-internal/integration-shims';
2
2
  export * from './index.bundle.base';
3
3
  export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core';
4
4
  export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration';
5
+ export { reportPageLoaded } from './tracing/reportPageLoaded';
5
6
  export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration };
6
7
  export { replayIntegration, getReplay } from '@sentry-internal/replay';
7
8
  //# sourceMappingURL=index.bundle.tracing.replay.d.ts.map
@@ -2,6 +2,7 @@ import { feedbackAsyncIntegration } from './feedbackAsync';
2
2
  export * from './index.bundle.base';
3
3
  export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core';
4
4
  export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration';
5
+ export { reportPageLoaded } from './tracing/reportPageLoaded';
5
6
  export { getFeedback, sendFeedback } from '@sentry-internal/feedback';
6
7
  export { feedbackAsyncIntegration as feedbackAsyncIntegration, feedbackAsyncIntegration as feedbackIntegration };
7
8
  export { replayIntegration, getReplay } from '@sentry-internal/replay';
@@ -1,13 +1,11 @@
1
1
  import { feedbackAsyncIntegration } from './feedbackAsync';
2
2
  import { feedbackSyncIntegration } from './feedbackSync';
3
- import * as logger from './log';
4
3
  export * from './exports';
5
- export { logger };
6
4
  export { reportingObserverIntegration } from './integrations/reportingobserver';
7
5
  export { httpClientIntegration } from './integrations/httpclient';
8
6
  export { contextLinesIntegration } from './integrations/contextlines';
9
7
  export { graphqlClientIntegration } from './integrations/graphqlClient';
10
- export { captureConsoleIntegration, extraErrorDataIntegration, rewriteFramesIntegration, consoleLoggingIntegration, } from '@sentry/core';
8
+ export { captureConsoleIntegration, extraErrorDataIntegration, rewriteFramesIntegration, consoleLoggingIntegration, createConsolaReporter, } from '@sentry/core';
11
9
  export { replayIntegration, getReplay } from '@sentry-internal/replay';
12
10
  export { ReplayEventType, ReplayEventWithTime, ReplayBreadcrumbFrame, ReplayBreadcrumbFrameEvent, ReplayOptionFrameEvent, ReplayFrame, ReplayFrameEvent, ReplaySpanFrame, ReplaySpanFrameEvent, } from '@sentry-internal/replay';
13
11
  export { replayCanvasIntegration } from '@sentry-internal/replay-canvas';
@@ -15,8 +13,9 @@ export { feedbackAsyncIntegration, feedbackSyncIntegration, feedbackSyncIntegrat
15
13
  export { getFeedback, sendFeedback } from '@sentry-internal/feedback';
16
14
  export { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './tracing/request';
17
15
  export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration';
16
+ export { reportPageLoaded } from './tracing/reportPageLoaded';
18
17
  export { RequestInstrumentationOptions } from './tracing/request';
19
- export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, } from '@sentry/core';
18
+ export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, logger, } from '@sentry/core';
20
19
  export { Span, FeatureFlagsIntegration } from '@sentry/core';
21
20
  export { makeBrowserOfflineTransport } from './transports/offline';
22
21
  export { browserProfilingIntegration } from './profiling/integration';
@@ -180,6 +180,22 @@ export interface BrowserTracingOptions {
180
180
  * @default `false` - this is an opt-in feature.
181
181
  */
182
182
  consistentTraceSampling: boolean;
183
+ /**
184
+ * If set to `true`, the pageload span will not end itself automatically, unless it
185
+ * runs until the {@link BrowserTracingOptions.finalTimeout} (30 seconds by default) is reached.
186
+ *
187
+ * Set this option to `true`, if you want full control over the pageload span duration.
188
+ * You can use `Sentry.reportPageLoaded()` to manually end the pageload span whenever convenient.
189
+ * Be aware that you have to ensure that this is always called, regardless of the chosen route
190
+ * or path in the application.
191
+ *
192
+ * @default `false`. By default, the pageload span will end itself automatically, based on
193
+ * the {@link BrowserTracingOptions.finalTimeout}, {@link BrowserTracingOptions.idleTimeout}
194
+ * and {@link BrowserTracingOptions.childSpanTimeout}. This is more convenient to use but means
195
+ * that the pageload duration can be arbitrary and might not be fully representative of a perceived
196
+ * page load time.
197
+ */
198
+ enableReportPageLoaded: boolean;
183
199
  /**
184
200
  * _experiments allows the user to send options to define how this integration works.
185
201
  *
@@ -220,7 +236,7 @@ export interface BrowserTracingOptions {
220
236
  *
221
237
  * We explicitly export the proper type here, as this has to be extended in some cases.
222
238
  */
223
- export declare const browserTracingIntegration: (_options?: Partial<BrowserTracingOptions>) => {
239
+ export declare const browserTracingIntegration: (options?: Partial<BrowserTracingOptions>) => {
224
240
  name: string;
225
241
  setup(client: Client<import("@sentry/core").ClientOptions<import("@sentry/core").BaseTransportOptions>>): void;
226
242
  afterAllSetup(client: Client<import("@sentry/core").ClientOptions<import("@sentry/core").BaseTransportOptions>>): void;
@@ -0,0 +1,11 @@
1
+ import { Client } from '@sentry/core';
2
+ /**
3
+ * Manually report the end of the page load, resulting in the SDK ending the pageload span.
4
+ * This only works if {@link BrowserTracingOptions.enableReportPageLoaded} is set to `true`.
5
+ * Otherwise, the pageload span will end itself based on the {@link BrowserTracingOptions.finalTimeout},
6
+ * {@link BrowserTracingOptions.idleTimeout} and {@link BrowserTracingOptions.childSpanTimeout}.
7
+ *
8
+ * @param client - The client to use. If not provided, the global client will be used.
9
+ */
10
+ export declare function reportPageLoaded(client?: Client | undefined): void;
11
+ //# sourceMappingURL=reportPageLoaded.d.ts.map
@@ -4,5 +4,5 @@ import { BrowserTransportOptions } from './types';
4
4
  /**
5
5
  * Creates a Transport that uses the Fetch API to send events to Sentry.
6
6
  */
7
- export declare function makeFetchTransport(options: BrowserTransportOptions, nativeFetch?: typeof WINDOW.fetch | undefined): Transport;
7
+ export declare function makeFetchTransport(options: BrowserTransportOptions, nativeFetch?: typeof WINDOW.fetch): Transport;
8
8
  //# sourceMappingURL=fetch.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/browser",
3
- "version": "10.11.0",
3
+ "version": "10.13.0",
4
4
  "description": "Official Sentry SDK for browsers",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
@@ -39,14 +39,14 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@sentry-internal/browser-utils": "10.11.0",
43
- "@sentry-internal/feedback": "10.11.0",
44
- "@sentry-internal/replay": "10.11.0",
45
- "@sentry-internal/replay-canvas": "10.11.0",
46
- "@sentry/core": "10.11.0"
42
+ "@sentry-internal/browser-utils": "10.13.0",
43
+ "@sentry-internal/feedback": "10.13.0",
44
+ "@sentry-internal/replay": "10.13.0",
45
+ "@sentry-internal/replay-canvas": "10.13.0",
46
+ "@sentry/core": "10.13.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@sentry-internal/integration-shims": "10.11.0",
49
+ "@sentry-internal/integration-shims": "10.13.0",
50
50
  "fake-indexeddb": "^4.0.1"
51
51
  },
52
52
  "scripts": {
@@ -1,213 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
-
5
- /**
6
- * Capture a log with the given level.
7
- *
8
- * @param level - The level of the log.
9
- * @param message - The message to log.
10
- * @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.
11
- * @param severityNumber - The severity number of the log.
12
- */
13
- function captureLog(
14
- level,
15
- message,
16
- attributes,
17
- severityNumber,
18
- ) {
19
- core._INTERNAL_captureLog({ level, message, attributes, severityNumber });
20
- }
21
-
22
- /**
23
- * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
24
- *
25
- * @param message - The message to log.
26
- * @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
27
- *
28
- * @example
29
- *
30
- * ```
31
- * Sentry.logger.trace('User clicked submit button', {
32
- * buttonId: 'submit-form',
33
- * formId: 'user-profile',
34
- * timestamp: Date.now()
35
- * });
36
- * ```
37
- *
38
- * @example With template strings
39
- *
40
- * ```
41
- * Sentry.logger.trace(Sentry.logger.fmt`User ${user} navigated to ${page}`, {
42
- * userId: '123',
43
- * sessionId: 'abc-xyz'
44
- * });
45
- * ```
46
- */
47
- function trace(message, attributes) {
48
- captureLog('trace', message, attributes);
49
- }
50
-
51
- /**
52
- * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
53
- *
54
- * @param message - The message to log.
55
- * @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
56
- *
57
- * @example
58
- *
59
- * ```
60
- * Sentry.logger.debug('Component mounted', {
61
- * component: 'UserProfile',
62
- * props: { userId: 123 },
63
- * renderTime: 150
64
- * });
65
- * ```
66
- *
67
- * @example With template strings
68
- *
69
- * ```
70
- * Sentry.logger.debug(Sentry.logger.fmt`API request to ${endpoint} failed`, {
71
- * statusCode: 404,
72
- * requestId: 'req-123',
73
- * duration: 250
74
- * });
75
- * ```
76
- */
77
- function debug(message, attributes) {
78
- captureLog('debug', message, attributes);
79
- }
80
-
81
- /**
82
- * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
83
- *
84
- * @param message - The message to log.
85
- * @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
86
- *
87
- * @example
88
- *
89
- * ```
90
- * Sentry.logger.info('User completed checkout', {
91
- * orderId: 'order-123',
92
- * amount: 99.99,
93
- * paymentMethod: 'credit_card'
94
- * });
95
- * ```
96
- *
97
- * @example With template strings
98
- *
99
- * ```
100
- * Sentry.logger.info(Sentry.logger.fmt`User ${user} updated profile picture`, {
101
- * userId: 'user-123',
102
- * imageSize: '2.5MB',
103
- * timestamp: Date.now()
104
- * });
105
- * ```
106
- */
107
- function info(message, attributes) {
108
- captureLog('info', message, attributes);
109
- }
110
-
111
- /**
112
- * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
113
- *
114
- * @param message - The message to log.
115
- * @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
116
- *
117
- * @example
118
- *
119
- * ```
120
- * Sentry.logger.warn('Browser compatibility issue detected', {
121
- * browser: 'Safari',
122
- * version: '14.0',
123
- * feature: 'WebRTC',
124
- * fallback: 'enabled'
125
- * });
126
- * ```
127
- *
128
- * @example With template strings
129
- *
130
- * ```
131
- * Sentry.logger.warn(Sentry.logger.fmt`API endpoint ${endpoint} is deprecated`, {
132
- * recommendedEndpoint: '/api/v2/users',
133
- * sunsetDate: '2024-12-31',
134
- * clientVersion: '1.2.3'
135
- * });
136
- * ```
137
- */
138
- function warn(message, attributes) {
139
- captureLog('warn', message, attributes);
140
- }
141
-
142
- /**
143
- * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
144
- *
145
- * @param message - The message to log.
146
- * @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
147
- *
148
- * @example
149
- *
150
- * ```
151
- * Sentry.logger.error('Failed to load user data', {
152
- * error: 'NetworkError',
153
- * url: '/api/users/123',
154
- * statusCode: 500,
155
- * retryCount: 3
156
- * });
157
- * ```
158
- *
159
- * @example With template strings
160
- *
161
- * ```
162
- * Sentry.logger.error(Sentry.logger.fmt`Payment processing failed for order ${orderId}`, {
163
- * error: 'InsufficientFunds',
164
- * amount: 100.00,
165
- * currency: 'USD',
166
- * userId: 'user-456'
167
- * });
168
- * ```
169
- */
170
- function error(message, attributes) {
171
- captureLog('error', message, attributes);
172
- }
173
-
174
- /**
175
- * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
176
- *
177
- * @param message - The message to log.
178
- * @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.
179
- *
180
- * @example
181
- *
182
- * ```
183
- * Sentry.logger.fatal('Application state corrupted', {
184
- * lastKnownState: 'authenticated',
185
- * sessionId: 'session-123',
186
- * timestamp: Date.now(),
187
- * recoveryAttempted: true
188
- * });
189
- * ```
190
- *
191
- * @example With template strings
192
- *
193
- * ```
194
- * Sentry.logger.fatal(Sentry.logger.fmt`Critical system failure in ${service}`, {
195
- * service: 'payment-processor',
196
- * errorCode: 'CRITICAL_FAILURE',
197
- * affectedUsers: 150,
198
- * timestamp: Date.now()
199
- * });
200
- * ```
201
- */
202
- function fatal(message, attributes) {
203
- captureLog('fatal', message, attributes);
204
- }
205
-
206
- exports.fmt = core.fmt;
207
- exports.debug = debug;
208
- exports.error = error;
209
- exports.fatal = fatal;
210
- exports.info = info;
211
- exports.trace = trace;
212
- exports.warn = warn;
213
- //# sourceMappingURL=log.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.js","sources":["../../../src/log.ts"],"sourcesContent":["import type { Log, LogSeverityLevel, ParameterizedString } from '@sentry/core';\nimport { _INTERNAL_captureLog } from '@sentry/core';\n\n/**\n * Capture a log with the given level.\n *\n * @param level - The level of the log.\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.\n * @param severityNumber - The severity number of the log.\n */\nfunction captureLog(\n level: LogSeverityLevel,\n message: ParameterizedString,\n attributes?: Log['attributes'],\n severityNumber?: Log['severityNumber'],\n): void {\n _INTERNAL_captureLog({ level, message, attributes, severityNumber });\n}\n\n/**\n * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.trace('User clicked submit button', {\n * buttonId: 'submit-form',\n * formId: 'user-profile',\n * timestamp: Date.now()\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.trace(Sentry.logger.fmt`User ${user} navigated to ${page}`, {\n * userId: '123',\n * sessionId: 'abc-xyz'\n * });\n * ```\n */\nexport function trace(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('trace', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.debug('Component mounted', {\n * component: 'UserProfile',\n * props: { userId: 123 },\n * renderTime: 150\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.debug(Sentry.logger.fmt`API request to ${endpoint} failed`, {\n * statusCode: 404,\n * requestId: 'req-123',\n * duration: 250\n * });\n * ```\n */\nexport function debug(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('debug', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.info('User completed checkout', {\n * orderId: 'order-123',\n * amount: 99.99,\n * paymentMethod: 'credit_card'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.info(Sentry.logger.fmt`User ${user} updated profile picture`, {\n * userId: 'user-123',\n * imageSize: '2.5MB',\n * timestamp: Date.now()\n * });\n * ```\n */\nexport function info(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('info', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.warn('Browser compatibility issue detected', {\n * browser: 'Safari',\n * version: '14.0',\n * feature: 'WebRTC',\n * fallback: 'enabled'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.warn(Sentry.logger.fmt`API endpoint ${endpoint} is deprecated`, {\n * recommendedEndpoint: '/api/v2/users',\n * sunsetDate: '2024-12-31',\n * clientVersion: '1.2.3'\n * });\n * ```\n */\nexport function warn(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('warn', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.error('Failed to load user data', {\n * error: 'NetworkError',\n * url: '/api/users/123',\n * statusCode: 500,\n * retryCount: 3\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.error(Sentry.logger.fmt`Payment processing failed for order ${orderId}`, {\n * error: 'InsufficientFunds',\n * amount: 100.00,\n * currency: 'USD',\n * userId: 'user-456'\n * });\n * ```\n */\nexport function error(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('error', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.fatal('Application state corrupted', {\n * lastKnownState: 'authenticated',\n * sessionId: 'session-123',\n * timestamp: Date.now(),\n * recoveryAttempted: true\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.fatal(Sentry.logger.fmt`Critical system failure in ${service}`, {\n * service: 'payment-processor',\n * errorCode: 'CRITICAL_FAILURE',\n * affectedUsers: 150,\n * timestamp: Date.now()\n * });\n * ```\n */\nexport function fatal(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('fatal', message, attributes);\n}\n\nexport { fmt } from '@sentry/core';\n"],"names":["_INTERNAL_captureLog"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU;AACnB,EAAE,KAAK;AACP,EAAE,OAAO;AACT,EAAE,UAAU;AACZ,EAAE,cAAc;AAChB,EAAQ;AACR,EAAEA,yBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,cAAA,EAAgB,CAAC;AACtE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAuB,UAAU,EAA4B;AACzF,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAuB,UAAU,EAA4B;AACzF,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;;;;;;;;;"}