@sentry/browser 10.15.0 → 10.19.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.
- package/build/npm/cjs/client.js +21 -2
- package/build/npm/cjs/client.js.map +1 -1
- package/build/npm/cjs/index.js +1 -0
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/esm/client.js +22 -3
- package/build/npm/esm/client.js.map +1 -1
- package/build/npm/esm/index.js +1 -1
- package/build/npm/esm/package.json +1 -1
- package/build/npm/types/client.d.ts +1 -0
- package/build/npm/types/client.d.ts.map +1 -1
- package/build/npm/types/exports.d.ts +1 -1
- package/build/npm/types/exports.d.ts.map +1 -1
- package/build/npm/types/helpers.d.ts +2 -0
- package/build/npm/types/helpers.d.ts.map +1 -1
- package/build/npm/types-ts3.8/client.d.ts +1 -0
- package/build/npm/types-ts3.8/exports.d.ts +1 -1
- package/build/npm/types-ts3.8/helpers.d.ts +2 -0
- package/package.json +7 -7
package/build/npm/cjs/client.js
CHANGED
|
@@ -39,9 +39,9 @@ class BrowserClient extends core.Client {
|
|
|
39
39
|
|
|
40
40
|
super(opts);
|
|
41
41
|
|
|
42
|
-
const { sendDefaultPii, sendClientReports, enableLogs } = this._options;
|
|
42
|
+
const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;
|
|
43
43
|
|
|
44
|
-
if (helpers.WINDOW.document && (sendClientReports || enableLogs)) {
|
|
44
|
+
if (helpers.WINDOW.document && (sendClientReports || enableLogs || _experiments?.enableMetrics)) {
|
|
45
45
|
helpers.WINDOW.document.addEventListener('visibilitychange', () => {
|
|
46
46
|
if (helpers.WINDOW.document.visibilityState === 'hidden') {
|
|
47
47
|
if (sendClientReports) {
|
|
@@ -50,6 +50,9 @@ class BrowserClient extends core.Client {
|
|
|
50
50
|
if (enableLogs) {
|
|
51
51
|
core._INTERNAL_flushLogsBuffer(this);
|
|
52
52
|
}
|
|
53
|
+
if (_experiments?.enableMetrics) {
|
|
54
|
+
core._INTERNAL_flushMetricsBuffer(this);
|
|
55
|
+
}
|
|
53
56
|
}
|
|
54
57
|
});
|
|
55
58
|
}
|
|
@@ -70,6 +73,22 @@ class BrowserClient extends core.Client {
|
|
|
70
73
|
});
|
|
71
74
|
}
|
|
72
75
|
|
|
76
|
+
if (_experiments?.enableMetrics) {
|
|
77
|
+
this.on('flush', () => {
|
|
78
|
+
core._INTERNAL_flushMetricsBuffer(this);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
this.on('afterCaptureMetric', () => {
|
|
82
|
+
if (this._metricFlushIdleTimeout) {
|
|
83
|
+
clearTimeout(this._metricFlushIdleTimeout);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
this._metricFlushIdleTimeout = setTimeout(() => {
|
|
87
|
+
core._INTERNAL_flushMetricsBuffer(this);
|
|
88
|
+
}, DEFAULT_FLUSH_INTERVAL);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
73
92
|
if (sendDefaultPii) {
|
|
74
93
|
this.on('beforeSendSession', core.addAutoIpAddressToSession);
|
|
75
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../../../src/client.ts"],"sourcesContent":["import type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options as CoreOptions,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\nconst DEFAULT_FLUSH_INTERVAL = 5000;\n\ntype BrowserSpecificOptions = BrowserClientReplayOptions &\n BrowserClientProfilingOptions & {\n /** If configured, this URL will be used as base URL for lazy loading integration. */\n cdnBaseUrl?: string;\n\n /**\n * Important: Only set this option if you know what you are doing!\n *\n * By default, the SDK will check if `Sentry.init` is called in a browser extension.\n * In case it is, it will stop initialization and log a warning\n * because browser extensions require a different Sentry initialization process:\n * https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/\n *\n * Setting up the SDK in a browser extension with global error monitoring is not recommended\n * and will likely flood you with errors from other web sites or extensions. This can heavily\n * impact your quota and cause interference with your and other Sentry SDKs in shared environments.\n *\n * If this check wrongfully flags your setup as a browser extension, you can set this\n * option to `true` to skip the check.\n *\n * @default false\n */\n skipBrowserExtensionCheck?: boolean;\n\n /**\n * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,\n * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}\n * option to control to which outgoing requests the header will be attached.\n *\n * **Important:** If you set this option to `true`, make sure that you configured your servers'\n * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.\n *\n * @see https://www.w3.org/TR/trace-context/\n *\n * @default false\n */\n propagateTraceparent?: boolean;\n };\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends Client<BrowserClientOptions> {\n private _logFlushIdleTimeout: ReturnType<typeof setTimeout> | undefined;\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const opts = applyDefaultOptions(options);\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n // Only allow IP inferral by Relay if sendDefaultPii is true\n if (opts._metadata?.sdk) {\n opts._metadata.sdk.settings = {\n infer_ip: opts.sendDefaultPii ? 'auto' : 'never',\n // purposefully allowing already passed settings to override the default\n ...opts._metadata.sdk.settings,\n };\n }\n\n super(opts);\n\n const { sendDefaultPii, sendClientReports, enableLogs } = this._options;\n\n if (WINDOW.document && (sendClientReports || enableLogs)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (enableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n }\n });\n }\n\n if (enableLogs) {\n this.on('flush', () => {\n _INTERNAL_flushLogsBuffer(this);\n });\n\n this.on('afterCaptureLog', () => {\n if (this._logFlushIdleTimeout) {\n clearTimeout(this._logFlushIdleTimeout);\n }\n\n this._logFlushIdleTimeout = setTimeout(() => {\n _INTERNAL_flushLogsBuffer(this);\n }, DEFAULT_FLUSH_INTERVAL);\n });\n }\n\n if (sendDefaultPii) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n currentScope: Scope,\n isolationScope: Scope,\n ): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n\n return super._prepareEvent(event, hint, currentScope, isolationScope);\n }\n}\n\n/** Exported only for tests. */\nexport function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T {\n return {\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects\n sendClientReports: true,\n // We default this to true, as it is the safer scenario\n parentSpanIsAlwaysRootSpan: true,\n ...optionsArg,\n };\n}\n"],"names":["Client","WINDOW","getSDKSource","applySdkMetadata","_INTERNAL_flushLogsBuffer","addAutoIpAddressToSession","eventFromException","eventFromMessage"],"mappings":";;;;;;AAsBA;AACA;AACA;;AAGA,MAAM,sBAAA,GAAyB,IAAI;;AAoDnC;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAA,SAAsBA,WAAM,CAAuB;;AAEhE;AACA;AACA;AACA;AACA;AACA,GAAS,WAAW,CAAC,OAAO,EAAwB;AACpD,IAAI,MAAM,IAAA,GAAO,mBAAmB,CAAC,OAAO,CAAC;AAC7C,IAAI,MAAM,YAAYC,cAAM,CAAC,iBAAA,IAAqBC,iBAAY,EAAE;AAChE,IAAIC,qBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;;AAE7D;AACA,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;AAC7B,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW;AACpC,QAAQ,QAAQ,EAAE,IAAI,CAAC,iBAAiB,MAAA,GAAS,OAAO;AACxD;AACA,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ;AACtC,OAAO;AACP;;AAEA,IAAI,KAAK,CAAC,IAAI,CAAC;;AAEf,IAAI,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAA,EAAW,GAAI,IAAI,CAAC,QAAQ;;AAE3E,IAAI,IAAIF,cAAM,CAAC,QAAA,KAAa,iBAAA,IAAqB,UAAU,CAAC,EAAE;AAC9D,MAAMA,cAAM,CAAC,QAAQ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AQ,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;AAC5G;;AAEA;AACA;AACA;AACA,GAAY,aAAa;AACzB,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAA+B;AAC/B,IAAI,KAAK,CAAC,QAAA,GAAW,KAAK,CAAC,QAAA,IAAY,YAAY;;AAEnD,IAAI,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC;AACzE;AACA;;AAEA;AACO,SAAS,mBAAmB,CAA0C,UAAU,EAAQ;AAC/F,EAAE,OAAO;AACT,IAAI,OAAO;AACX,MAAM,OAAO,uBAAuB,QAAA;AACpC,UAAU;AACV,UAAUN,cAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;;"}
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../../../src/client.ts"],"sourcesContent":["import type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options as CoreOptions,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n _INTERNAL_flushMetricsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\nconst DEFAULT_FLUSH_INTERVAL = 5000;\n\ntype BrowserSpecificOptions = BrowserClientReplayOptions &\n BrowserClientProfilingOptions & {\n /** If configured, this URL will be used as base URL for lazy loading integration. */\n cdnBaseUrl?: string;\n\n /**\n * Important: Only set this option if you know what you are doing!\n *\n * By default, the SDK will check if `Sentry.init` is called in a browser extension.\n * In case it is, it will stop initialization and log a warning\n * because browser extensions require a different Sentry initialization process:\n * https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/\n *\n * Setting up the SDK in a browser extension with global error monitoring is not recommended\n * and will likely flood you with errors from other web sites or extensions. This can heavily\n * impact your quota and cause interference with your and other Sentry SDKs in shared environments.\n *\n * If this check wrongfully flags your setup as a browser extension, you can set this\n * option to `true` to skip the check.\n *\n * @default false\n */\n skipBrowserExtensionCheck?: boolean;\n\n /**\n * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,\n * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}\n * option to control to which outgoing requests the header will be attached.\n *\n * **Important:** If you set this option to `true`, make sure that you configured your servers'\n * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.\n *\n * @see https://www.w3.org/TR/trace-context/\n *\n * @default false\n */\n propagateTraceparent?: boolean;\n };\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends Client<BrowserClientOptions> {\n private _logFlushIdleTimeout: ReturnType<typeof setTimeout> | undefined;\n private _metricFlushIdleTimeout: ReturnType<typeof setTimeout> | undefined;\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const opts = applyDefaultOptions(options);\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n // Only allow IP inferral by Relay if sendDefaultPii is true\n if (opts._metadata?.sdk) {\n opts._metadata.sdk.settings = {\n infer_ip: opts.sendDefaultPii ? 'auto' : 'never',\n // purposefully allowing already passed settings to override the default\n ...opts._metadata.sdk.settings,\n };\n }\n\n super(opts);\n\n const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;\n\n if (WINDOW.document && (sendClientReports || enableLogs || _experiments?.enableMetrics)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (enableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n if (_experiments?.enableMetrics) {\n _INTERNAL_flushMetricsBuffer(this);\n }\n }\n });\n }\n\n if (enableLogs) {\n this.on('flush', () => {\n _INTERNAL_flushLogsBuffer(this);\n });\n\n this.on('afterCaptureLog', () => {\n if (this._logFlushIdleTimeout) {\n clearTimeout(this._logFlushIdleTimeout);\n }\n\n this._logFlushIdleTimeout = setTimeout(() => {\n _INTERNAL_flushLogsBuffer(this);\n }, DEFAULT_FLUSH_INTERVAL);\n });\n }\n\n if (_experiments?.enableMetrics) {\n this.on('flush', () => {\n _INTERNAL_flushMetricsBuffer(this);\n });\n\n this.on('afterCaptureMetric', () => {\n if (this._metricFlushIdleTimeout) {\n clearTimeout(this._metricFlushIdleTimeout);\n }\n\n this._metricFlushIdleTimeout = setTimeout(() => {\n _INTERNAL_flushMetricsBuffer(this);\n }, DEFAULT_FLUSH_INTERVAL);\n });\n }\n\n if (sendDefaultPii) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n currentScope: Scope,\n isolationScope: Scope,\n ): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n\n return super._prepareEvent(event, hint, currentScope, isolationScope);\n }\n}\n\n/** Exported only for tests. */\nexport function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T {\n return {\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects\n sendClientReports: true,\n // We default this to true, as it is the safer scenario\n parentSpanIsAlwaysRootSpan: true,\n ...optionsArg,\n };\n}\n"],"names":["Client","WINDOW","getSDKSource","applySdkMetadata","_INTERNAL_flushLogsBuffer","_INTERNAL_flushMetricsBuffer","addAutoIpAddressToSession","eventFromException","eventFromMessage"],"mappings":";;;;;;AAuBA;AACA;AACA;;AAGA,MAAM,sBAAA,GAAyB,IAAI;;AAoDnC;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAA,SAAsBA,WAAM,CAAuB;;AAGhE;AACA;AACA;AACA;AACA;AACA,GAAS,WAAW,CAAC,OAAO,EAAwB;AACpD,IAAI,MAAM,IAAA,GAAO,mBAAmB,CAAC,OAAO,CAAC;AAC7C,IAAI,MAAM,YAAYC,cAAM,CAAC,iBAAA,IAAqBC,iBAAY,EAAE;AAChE,IAAIC,qBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;;AAE7D;AACA,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;AAC7B,MAAM,IAAI,CAAC,SAAS,CAAC,GAA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C,QAAA,GAAW,KAAK,CAAC,QAAA,IAAY,YAAY;;AAEnD,IAAI,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC;AACzE;AACA;;AAEA;AACO,SAAS,mBAAmB,CAA0C,UAAU,EAAQ;AAC/F,EAAE,OAAO;AACT,IAAI,OAAO;AACX,MAAM,OAAO,uBAAuB,QAAA;AACpC,UAAU;AACV,UAAUP,cAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;;"}
|
package/build/npm/cjs/index.js
CHANGED
|
@@ -87,6 +87,7 @@ exports.isInitialized = core.isInitialized;
|
|
|
87
87
|
exports.lastEventId = core.lastEventId;
|
|
88
88
|
exports.logger = core.logger;
|
|
89
89
|
exports.makeMultiplexedTransport = core.makeMultiplexedTransport;
|
|
90
|
+
exports.metrics = core.metrics;
|
|
90
91
|
exports.moduleMetadataIntegration = core.moduleMetadataIntegration;
|
|
91
92
|
exports.parameterize = core.parameterize;
|
|
92
93
|
exports.registerSpanErrorInstrumentation = core.registerSpanErrorInstrumentation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/npm/esm/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, getSDKSource, applySdkMetadata, _INTERNAL_flushLogsBuffer, addAutoIpAddressToSession } from '@sentry/core';
|
|
1
|
+
import { Client, getSDKSource, applySdkMetadata, _INTERNAL_flushLogsBuffer, _INTERNAL_flushMetricsBuffer, addAutoIpAddressToSession } from '@sentry/core';
|
|
2
2
|
import { eventFromException, eventFromMessage } from './eventbuilder.js';
|
|
3
3
|
import { WINDOW } from './helpers.js';
|
|
4
4
|
|
|
@@ -37,9 +37,9 @@ class BrowserClient extends Client {
|
|
|
37
37
|
|
|
38
38
|
super(opts);
|
|
39
39
|
|
|
40
|
-
const { sendDefaultPii, sendClientReports, enableLogs } = this._options;
|
|
40
|
+
const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;
|
|
41
41
|
|
|
42
|
-
if (WINDOW.document && (sendClientReports || enableLogs)) {
|
|
42
|
+
if (WINDOW.document && (sendClientReports || enableLogs || _experiments?.enableMetrics)) {
|
|
43
43
|
WINDOW.document.addEventListener('visibilitychange', () => {
|
|
44
44
|
if (WINDOW.document.visibilityState === 'hidden') {
|
|
45
45
|
if (sendClientReports) {
|
|
@@ -48,6 +48,9 @@ class BrowserClient extends Client {
|
|
|
48
48
|
if (enableLogs) {
|
|
49
49
|
_INTERNAL_flushLogsBuffer(this);
|
|
50
50
|
}
|
|
51
|
+
if (_experiments?.enableMetrics) {
|
|
52
|
+
_INTERNAL_flushMetricsBuffer(this);
|
|
53
|
+
}
|
|
51
54
|
}
|
|
52
55
|
});
|
|
53
56
|
}
|
|
@@ -68,6 +71,22 @@ class BrowserClient extends Client {
|
|
|
68
71
|
});
|
|
69
72
|
}
|
|
70
73
|
|
|
74
|
+
if (_experiments?.enableMetrics) {
|
|
75
|
+
this.on('flush', () => {
|
|
76
|
+
_INTERNAL_flushMetricsBuffer(this);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
this.on('afterCaptureMetric', () => {
|
|
80
|
+
if (this._metricFlushIdleTimeout) {
|
|
81
|
+
clearTimeout(this._metricFlushIdleTimeout);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this._metricFlushIdleTimeout = setTimeout(() => {
|
|
85
|
+
_INTERNAL_flushMetricsBuffer(this);
|
|
86
|
+
}, DEFAULT_FLUSH_INTERVAL);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
71
90
|
if (sendDefaultPii) {
|
|
72
91
|
this.on('beforeSendSession', addAutoIpAddressToSession);
|
|
73
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../../../src/client.ts"],"sourcesContent":["import type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options as CoreOptions,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\nconst DEFAULT_FLUSH_INTERVAL = 5000;\n\ntype BrowserSpecificOptions = BrowserClientReplayOptions &\n BrowserClientProfilingOptions & {\n /** If configured, this URL will be used as base URL for lazy loading integration. */\n cdnBaseUrl?: string;\n\n /**\n * Important: Only set this option if you know what you are doing!\n *\n * By default, the SDK will check if `Sentry.init` is called in a browser extension.\n * In case it is, it will stop initialization and log a warning\n * because browser extensions require a different Sentry initialization process:\n * https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/\n *\n * Setting up the SDK in a browser extension with global error monitoring is not recommended\n * and will likely flood you with errors from other web sites or extensions. This can heavily\n * impact your quota and cause interference with your and other Sentry SDKs in shared environments.\n *\n * If this check wrongfully flags your setup as a browser extension, you can set this\n * option to `true` to skip the check.\n *\n * @default false\n */\n skipBrowserExtensionCheck?: boolean;\n\n /**\n * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,\n * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}\n * option to control to which outgoing requests the header will be attached.\n *\n * **Important:** If you set this option to `true`, make sure that you configured your servers'\n * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.\n *\n * @see https://www.w3.org/TR/trace-context/\n *\n * @default false\n */\n propagateTraceparent?: boolean;\n };\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends Client<BrowserClientOptions> {\n private _logFlushIdleTimeout: ReturnType<typeof setTimeout> | undefined;\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const opts = applyDefaultOptions(options);\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n // Only allow IP inferral by Relay if sendDefaultPii is true\n if (opts._metadata?.sdk) {\n opts._metadata.sdk.settings = {\n infer_ip: opts.sendDefaultPii ? 'auto' : 'never',\n // purposefully allowing already passed settings to override the default\n ...opts._metadata.sdk.settings,\n };\n }\n\n super(opts);\n\n const { sendDefaultPii, sendClientReports, enableLogs } = this._options;\n\n if (WINDOW.document && (sendClientReports || enableLogs)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (enableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n }\n });\n }\n\n if (enableLogs) {\n this.on('flush', () => {\n _INTERNAL_flushLogsBuffer(this);\n });\n\n this.on('afterCaptureLog', () => {\n if (this._logFlushIdleTimeout) {\n clearTimeout(this._logFlushIdleTimeout);\n }\n\n this._logFlushIdleTimeout = setTimeout(() => {\n _INTERNAL_flushLogsBuffer(this);\n }, DEFAULT_FLUSH_INTERVAL);\n });\n }\n\n if (sendDefaultPii) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n currentScope: Scope,\n isolationScope: Scope,\n ): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n\n return super._prepareEvent(event, hint, currentScope, isolationScope);\n }\n}\n\n/** Exported only for tests. */\nexport function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T {\n return {\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects\n sendClientReports: true,\n // We default this to true, as it is the safer scenario\n parentSpanIsAlwaysRootSpan: true,\n ...optionsArg,\n };\n}\n"],"names":[],"mappings":";;;;AAsBA;AACA;AACA;;AAGA,MAAM,sBAAA,GAAyB,IAAI;;AAoDnC;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAA,SAAsB,MAAM,CAAuB;;AAEhE;AACA;AACA;AACA;AACA;AACA,GAAS,WAAW,CAAC,OAAO,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AAU,MAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../../../src/client.ts"],"sourcesContent":["import type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options as CoreOptions,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n _INTERNAL_flushMetricsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\nconst DEFAULT_FLUSH_INTERVAL = 5000;\n\ntype BrowserSpecificOptions = BrowserClientReplayOptions &\n BrowserClientProfilingOptions & {\n /** If configured, this URL will be used as base URL for lazy loading integration. */\n cdnBaseUrl?: string;\n\n /**\n * Important: Only set this option if you know what you are doing!\n *\n * By default, the SDK will check if `Sentry.init` is called in a browser extension.\n * In case it is, it will stop initialization and log a warning\n * because browser extensions require a different Sentry initialization process:\n * https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/\n *\n * Setting up the SDK in a browser extension with global error monitoring is not recommended\n * and will likely flood you with errors from other web sites or extensions. This can heavily\n * impact your quota and cause interference with your and other Sentry SDKs in shared environments.\n *\n * If this check wrongfully flags your setup as a browser extension, you can set this\n * option to `true` to skip the check.\n *\n * @default false\n */\n skipBrowserExtensionCheck?: boolean;\n\n /**\n * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,\n * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}\n * option to control to which outgoing requests the header will be attached.\n *\n * **Important:** If you set this option to `true`, make sure that you configured your servers'\n * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.\n *\n * @see https://www.w3.org/TR/trace-context/\n *\n * @default false\n */\n propagateTraceparent?: boolean;\n };\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends Client<BrowserClientOptions> {\n private _logFlushIdleTimeout: ReturnType<typeof setTimeout> | undefined;\n private _metricFlushIdleTimeout: ReturnType<typeof setTimeout> | undefined;\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const opts = applyDefaultOptions(options);\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n // Only allow IP inferral by Relay if sendDefaultPii is true\n if (opts._metadata?.sdk) {\n opts._metadata.sdk.settings = {\n infer_ip: opts.sendDefaultPii ? 'auto' : 'never',\n // purposefully allowing already passed settings to override the default\n ...opts._metadata.sdk.settings,\n };\n }\n\n super(opts);\n\n const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;\n\n if (WINDOW.document && (sendClientReports || enableLogs || _experiments?.enableMetrics)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (enableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n if (_experiments?.enableMetrics) {\n _INTERNAL_flushMetricsBuffer(this);\n }\n }\n });\n }\n\n if (enableLogs) {\n this.on('flush', () => {\n _INTERNAL_flushLogsBuffer(this);\n });\n\n this.on('afterCaptureLog', () => {\n if (this._logFlushIdleTimeout) {\n clearTimeout(this._logFlushIdleTimeout);\n }\n\n this._logFlushIdleTimeout = setTimeout(() => {\n _INTERNAL_flushLogsBuffer(this);\n }, DEFAULT_FLUSH_INTERVAL);\n });\n }\n\n if (_experiments?.enableMetrics) {\n this.on('flush', () => {\n _INTERNAL_flushMetricsBuffer(this);\n });\n\n this.on('afterCaptureMetric', () => {\n if (this._metricFlushIdleTimeout) {\n clearTimeout(this._metricFlushIdleTimeout);\n }\n\n this._metricFlushIdleTimeout = setTimeout(() => {\n _INTERNAL_flushMetricsBuffer(this);\n }, DEFAULT_FLUSH_INTERVAL);\n });\n }\n\n if (sendDefaultPii) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n currentScope: Scope,\n isolationScope: Scope,\n ): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n\n return super._prepareEvent(event, hint, currentScope, isolationScope);\n }\n}\n\n/** Exported only for tests. */\nexport function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T {\n return {\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects\n sendClientRe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AAC,SAAS,EAAW,IAAI,EAAkC;AACtF,IAAI,OAAO,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;AACzG;;AAEA;AACA;AACA;AACA,GAAS,gBAAgB;AACzB,IAAI,OAAO;AACX,IAAI,KAAK,GAAkB,MAAM;AACjC,IAAI,IAAI;AACR,IAAwB;AACxB,IAAI,OAAO,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;AAC5G;;AAEA;AACA;AACA;AACA,GAAY,aAAa;AACzB,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAA+B;AAC/B,IAAI,KAAK,CAAC,QAAA,GAAW,KAAK,CAAC,QAAA,IAAY,YAAY;;AAEnD,IAAI,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC;AACzE;AACA;;AAEA;AACO,SAAS,mBAAmB,CAA0C,UAAU,EAAQ;AAC/F,EAAE,OAAO;AACT,IAAI,OAAO;AACX,MAAM,OAAO,uBAAuB,QAAA;AACpC,UAAU;AACV,UAAU,MAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;"}
|
package/build/npm/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { feedbackAsyncIntegration } from './feedbackAsync.js';
|
|
2
2
|
export { feedbackSyncIntegration as feedbackIntegration, feedbackSyncIntegration } from './feedbackSync.js';
|
|
3
|
-
export { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, captureConsoleIntegration, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, consoleLoggingIntegration, continueTrace, createConsolaReporter, createTransport, dedupeIntegration, endSession, eventFiltersIntegration, extraErrorDataIntegration, featureFlagsIntegration, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, inboundFiltersIntegration, instrumentSupabaseClient, isEnabled, isInitialized, lastEventId, logger, makeMultiplexedTransport, moduleMetadataIntegration, parameterize, registerSpanErrorInstrumentation, rewriteFramesIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToBaggageHeader, spanToJSON, spanToTraceHeader, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, supabaseIntegration, suppressTracing, thirdPartyErrorFilterIntegration, updateSpanName, withActiveSpan, withIsolationScope, withScope, zodErrorsIntegration } from '@sentry/core';
|
|
3
|
+
export { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, captureConsoleIntegration, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, consoleLoggingIntegration, continueTrace, createConsolaReporter, createTransport, dedupeIntegration, endSession, eventFiltersIntegration, extraErrorDataIntegration, featureFlagsIntegration, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, inboundFiltersIntegration, instrumentSupabaseClient, isEnabled, isInitialized, lastEventId, logger, makeMultiplexedTransport, metrics, moduleMetadataIntegration, parameterize, registerSpanErrorInstrumentation, rewriteFramesIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToBaggageHeader, spanToJSON, spanToTraceHeader, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, supabaseIntegration, suppressTracing, thirdPartyErrorFilterIntegration, updateSpanName, withActiveSpan, withIsolationScope, withScope, zodErrorsIntegration } from '@sentry/core';
|
|
4
4
|
export { WINDOW } from './helpers.js';
|
|
5
5
|
export { BrowserClient } from './client.js';
|
|
6
6
|
export { makeFetchTransport } from './transports/fetch.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.19.0","sideEffects":false}
|
|
@@ -54,6 +54,7 @@ export type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & Brow
|
|
|
54
54
|
*/
|
|
55
55
|
export declare class BrowserClient extends Client<BrowserClientOptions> {
|
|
56
56
|
private _logFlushIdleTimeout;
|
|
57
|
+
private _metricFlushIdleTimeout;
|
|
57
58
|
/**
|
|
58
59
|
* Creates a new Browser SDK instance.
|
|
59
60
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC1B,aAAa,EACb,KAAK,EACL,SAAS,EACT,OAAO,IAAI,WAAW,EACtB,mBAAmB,EACnB,KAAK,EACL,aAAa,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC1B,aAAa,EACb,KAAK,EACL,SAAS,EACT,OAAO,IAAI,WAAW,EACtB,mB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,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,OAAO,CAAC,oBAAoB,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAW7F"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { Breadcrumb, BreadcrumbHint, Context, Contexts, RequestEventData, SdkInfo, Event, EventHint, ErrorEvent, Exception, SeverityLevel, StackFrame, Stacktrace, Thread, User, Session, ReportDialogOptions, } from '@sentry/core';
|
|
2
2
|
export type { BrowserOptions } from './client';
|
|
3
|
-
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureFeedback, captureMessage, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getIsolationScope, getGlobalScope, setCurrentClient, Scope, continueTrace, getTraceData, suppressTracing, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, withIsolationScope, functionToStringIntegration, inboundFiltersIntegration, eventFiltersIntegration, dedupeIntegration, parameterize, startSession, captureSession, endSession, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, } from '@sentry/core';
|
|
3
|
+
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureFeedback, captureMessage, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getIsolationScope, getGlobalScope, setCurrentClient, Scope, continueTrace, getTraceData, suppressTracing, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, withIsolationScope, functionToStringIntegration, inboundFiltersIntegration, eventFiltersIntegration, dedupeIntegration, parameterize, startSession, captureSession, endSession, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, metrics, } from '@sentry/core';
|
|
4
4
|
export { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, } from '@sentry/core';
|
|
5
5
|
export { WINDOW } from './helpers';
|
|
6
6
|
export { BrowserClient } from './client';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/exports.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,OAAO,EACP,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,KAAK,EACL,eAAe,EACf,WAAW,EACX,KAAK,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,2BAA2B,EAE3B,yBAAyB,EACzB,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/exports.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,OAAO,EACP,mBAAmB,GACpB,M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;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -24,6 +24,8 @@ export declare const WINDOW: {
|
|
|
24
24
|
_sentryDebugIds?: Record<string, string> | undefined;
|
|
25
25
|
_sentryModuleMetadata?: Record<string, any> | undefined;
|
|
26
26
|
_sentryEsmLoaderHookRegistered?: boolean | undefined;
|
|
27
|
+
_sentryInjectLoaderHookRegister?: (() => void) | undefined;
|
|
28
|
+
_sentryInjectLoaderHookRegistered?: boolean | undefined;
|
|
27
29
|
} & import("@sentry/core").Carrier & Window;
|
|
28
30
|
/**
|
|
29
31
|
* @hidden
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAa/D,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAa/D,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAA2C,CAAC;AAI/D;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC;AAGD,KAAK,iBAAiB,GAAG,QAAQ,CAAC;AAElC,wBAAgB,IAAI,CAAC,CAAC,SAAS,iBAAiB,EAC9C,EAAE,EAAE,CAAC,EACL,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACA,eAAe,CAAC,CAAC,CAAC,CAAC;AACtB,wBAAgB,IAAI,CAAC,WAAW,EAC9B,EAAE,EAAE,WAAW,EACf,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACA,WAAW,CAAC;AAmIf;;GAEG;AACH,wBAAgB,kBAAkB,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAgBrF"}
|
|
@@ -54,6 +54,7 @@ export type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & Brow
|
|
|
54
54
|
*/
|
|
55
55
|
export declare class BrowserClient extends Client<BrowserClientOptions> {
|
|
56
56
|
private _logFlushIdleTimeout;
|
|
57
|
+
private _metricFlushIdleTimeout;
|
|
57
58
|
/**
|
|
58
59
|
* Creates a new Browser SDK instance.
|
|
59
60
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Breadcrumb, BreadcrumbHint, Context, Contexts, RequestEventData, SdkInfo, Event, EventHint, ErrorEvent, Exception, SeverityLevel, StackFrame, Stacktrace, Thread, User, Session, ReportDialogOptions, } from '@sentry/core';
|
|
2
2
|
export { BrowserOptions } from './client';
|
|
3
|
-
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureFeedback, captureMessage, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getIsolationScope, getGlobalScope, setCurrentClient, Scope, continueTrace, getTraceData, suppressTracing, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, withIsolationScope, functionToStringIntegration, inboundFiltersIntegration, eventFiltersIntegration, dedupeIntegration, parameterize, startSession, captureSession, endSession, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, } from '@sentry/core';
|
|
3
|
+
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureFeedback, captureMessage, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getIsolationScope, getGlobalScope, setCurrentClient, Scope, continueTrace, getTraceData, suppressTracing, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, withIsolationScope, functionToStringIntegration, inboundFiltersIntegration, eventFiltersIntegration, dedupeIntegration, parameterize, startSession, captureSession, endSession, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, metrics, } from '@sentry/core';
|
|
4
4
|
export { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, } from '@sentry/core';
|
|
5
5
|
export { WINDOW } from './helpers';
|
|
6
6
|
export { BrowserClient } from './client';
|
|
@@ -24,6 +24,8 @@ export declare const WINDOW: {
|
|
|
24
24
|
_sentryDebugIds?: Record<string, string> | undefined;
|
|
25
25
|
_sentryModuleMetadata?: Record<string, any> | undefined;
|
|
26
26
|
_sentryEsmLoaderHookRegistered?: boolean | undefined;
|
|
27
|
+
_sentryInjectLoaderHookRegister?: (() => void) | undefined;
|
|
28
|
+
_sentryInjectLoaderHookRegistered?: boolean | undefined;
|
|
27
29
|
} & import("@sentry/core").Carrier & Window;
|
|
28
30
|
/**
|
|
29
31
|
* @hidden
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/browser",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.19.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.
|
|
43
|
-
"@sentry-internal/feedback": "10.
|
|
44
|
-
"@sentry-internal/replay": "10.
|
|
45
|
-
"@sentry-internal/replay-canvas": "10.
|
|
46
|
-
"@sentry/core": "10.
|
|
42
|
+
"@sentry-internal/browser-utils": "10.19.0",
|
|
43
|
+
"@sentry-internal/feedback": "10.19.0",
|
|
44
|
+
"@sentry-internal/replay": "10.19.0",
|
|
45
|
+
"@sentry-internal/replay-canvas": "10.19.0",
|
|
46
|
+
"@sentry/core": "10.19.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@sentry-internal/integration-shims": "10.
|
|
49
|
+
"@sentry-internal/integration-shims": "10.19.0",
|
|
50
50
|
"fake-indexeddb": "^4.0.1"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|