@sentry/browser 9.44.2 → 10.1.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.
@@ -30,24 +30,22 @@ class BrowserClient extends core.Client {
30
30
 
31
31
  super(opts);
32
32
 
33
- const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;
34
- // eslint-disable-next-line deprecation/deprecation
35
- const shouldEnableLogs = enableLogs ?? _experiments?.enableLogs;
33
+ const { sendDefaultPii, sendClientReports, enableLogs } = this._options;
36
34
 
37
- if (helpers.WINDOW.document && (sendClientReports || shouldEnableLogs)) {
35
+ if (helpers.WINDOW.document && (sendClientReports || enableLogs)) {
38
36
  helpers.WINDOW.document.addEventListener('visibilitychange', () => {
39
37
  if (helpers.WINDOW.document.visibilityState === 'hidden') {
40
38
  if (sendClientReports) {
41
39
  this._flushOutcomes();
42
40
  }
43
- if (shouldEnableLogs) {
41
+ if (enableLogs) {
44
42
  core._INTERNAL_flushLogsBuffer(this);
45
43
  }
46
44
  }
47
45
  });
48
46
  }
49
47
 
50
- if (shouldEnableLogs) {
48
+ if (enableLogs) {
51
49
  this.on('flush', () => {
52
50
  core._INTERNAL_flushLogsBuffer(this);
53
51
  });
@@ -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,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n addAutoIpAddressToSession,\n addAutoIpAddressToUser,\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 * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = Options<BrowserTransportOptions> &\n BrowserSpecificOptions & {\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/**\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 super(opts);\n\n const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;\n // eslint-disable-next-line deprecation/deprecation\n const shouldEnableLogs = enableLogs ?? _experiments?.enableLogs;\n\n if (WINDOW.document && (sendClientReports || shouldEnableLogs)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (shouldEnableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n }\n });\n }\n\n if (shouldEnableLogs) {\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('postprocessEvent', addAutoIpAddressToUser);\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","addAutoIpAddressToUser","addAutoIpAddressToSession","eventFromException","eventFromMessage"],"mappings":";;;;;;AAuBA;AACA;AACA;;AAGA,MAAM,sBAAA,GAAyB,IAAI;;AAuCnC;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,IAAI,KAAK,CAAC,IAAI,CAAC;;AAEf,IAAI,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAA,EAAa,GAAI,IAAI,CAAC,QAAQ;AACzF;AACA,IAAI,MAAM,gBAAA,GAAmB,cAAc,YAAY,EAAE,UAAU;;AAEnE,IAAI,IAAIF,cAAM,CAAC,QAAA,KAAa,iBAAA,IAAqB,gBAAgB,CAAC,EAAE;AACpE,MAAMA,cAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,MAAM;AACjE,QAAQ,IAAIA,cAAM,CAAC,QAAQ,CAAC,eAAA,KAAoB,QAAQ,EAAE;AAC1D,UAAU,IAAI,iBAAiB,EAAE;AACjC,YAAY,IAAI,CAAC,cAAc,EAAE;AACjC;AACA,UAAU,IAAI,gBAAgB,EAAE;AAChC,YAAYG,8BAAyB,CAAC,IAAI,CAAC;AAC3C;AACA;AACA,OAAO,CAAC;AACR;;AAEA,IAAI,IAAI,gBAAgB,EAAE;AAC1B,MAAM,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM;AAC7B,QAAQA,8BAAyB,CAAC,IAAI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AAI,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;;;;;"}
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,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n addAutoIpAddressToSession,\n addAutoIpAddressToUser,\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 * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = Options<BrowserTransportOptions> &\n BrowserSpecificOptions & {\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/**\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 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('postprocessEvent', addAutoIpAddressToUser);\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","addAutoIpAddressToUser","addAutoIpAddressToSession","eventFromException","eventFromMessage"],"mappings":";;;;;;AAuBA;AACA;AACA;;AAGA,MAAM,sBAAA,GAAyB,IAAI;;AAuCnC;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,IAAI,KAAK,CAAC,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,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,OAAOC,6BAAgB,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,UAAUP,cAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;;"}
@@ -25,20 +25,22 @@ async function diagnoseSdkConnectivity()
25
25
  }
26
26
 
27
27
  try {
28
- // If fetch throws, there is likely an ad blocker active or there are other connective issues.
29
- await fetch(
30
- // We are using the
31
- // - "sentry-sdks" org with id 447951 not to pollute any actual organizations.
32
- // - "diagnose-sdk-connectivity" project with id 4509632503087104
33
- // - the public key of said org/project, which is disabled in the project settings
34
- // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)
35
- 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',
36
- {
37
- body: '{}',
38
- method: 'POST',
39
- mode: 'cors',
40
- credentials: 'omit',
41
- },
28
+ await core.suppressTracing(() =>
29
+ // If fetch throws, there is likely an ad blocker active or there are other connective issues.
30
+ fetch(
31
+ // We are using the
32
+ // - "sentry-sdks" org with id 447951 not to pollute any actual organizations.
33
+ // - "diagnose-sdk-connectivity" project with id 4509632503087104
34
+ // - the public key of said org/project, which is disabled in the project settings
35
+ // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)
36
+ 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',
37
+ {
38
+ body: '{}',
39
+ method: 'POST',
40
+ mode: 'cors',
41
+ credentials: 'omit',
42
+ },
43
+ ),
42
44
  );
43
45
  } catch {
44
46
  return 'sentry-unreachable';
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose-sdk.js","sources":["../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient } from '@sentry/core';\n\n/**\n * A function to diagnose why the SDK might not be successfully sending data.\n *\n * Possible return values wrapped in a Promise:\n * - `\"no-client-active\"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.\n * - `\"sentry-unreachable\"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.\n *\n * If the function doesn't detect an issue it resolves to `undefined`.\n */\nexport async function diagnoseSdkConnectivity(): Promise<\n 'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void\n> {\n const client = getClient();\n\n if (!client) {\n return 'no-client-active';\n }\n\n if (!client.getDsn()) {\n return 'no-dsn-configured';\n }\n\n try {\n // If fetch throws, there is likely an ad blocker active or there are other connective issues.\n await fetch(\n // We are using the\n // - \"sentry-sdks\" org with id 447951 not to pollute any actual organizations.\n // - \"diagnose-sdk-connectivity\" project with id 4509632503087104\n // - the public key of said org/project, which is disabled in the project settings\n // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)\n 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',\n {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n },\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":["getClient"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,uBAAuB;;AAE7C,CAAE;AACF,EAAE,MAAM,MAAA,GAASA,cAAS,EAAE;;AAE5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,kBAAkB;AAC7B;;AAEA,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;AACxB,IAAI,OAAO,mBAAmB;AAC9B;;AAEA,EAAE,IAAI;AACN;AACA,IAAI,MAAM,KAAK;AACf;AACA;AACA;AACA;AACA;AACA,MAAM,+KAA+K;AACrL,MAAM;AACN,QAAQ,IAAI,EAAE,IAAI;AAClB,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,IAAI,EAAE,MAAM;AACpB,QAAQ,WAAW,EAAE,MAAM;AAC3B,OAAO;AACP,KAAK;AACL,IAAI,MAAM;AACV,IAAI,OAAO,oBAAoB;AAC/B;AACA;;;;"}
1
+ {"version":3,"file":"diagnose-sdk.js","sources":["../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient, suppressTracing } from '@sentry/core';\n\n/**\n * A function to diagnose why the SDK might not be successfully sending data.\n *\n * Possible return values wrapped in a Promise:\n * - `\"no-client-active\"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.\n * - `\"sentry-unreachable\"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.\n *\n * If the function doesn't detect an issue it resolves to `undefined`.\n */\nexport async function diagnoseSdkConnectivity(): Promise<\n 'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void\n> {\n const client = getClient();\n\n if (!client) {\n return 'no-client-active';\n }\n\n if (!client.getDsn()) {\n return 'no-dsn-configured';\n }\n\n try {\n await suppressTracing(() =>\n // If fetch throws, there is likely an ad blocker active or there are other connective issues.\n fetch(\n // We are using the\n // - \"sentry-sdks\" org with id 447951 not to pollute any actual organizations.\n // - \"diagnose-sdk-connectivity\" project with id 4509632503087104\n // - the public key of said org/project, which is disabled in the project settings\n // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)\n 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',\n {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n },\n ),\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":["getClient","suppressTracing"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,uBAAuB;;AAE7C,CAAE;AACF,EAAE,MAAM,MAAA,GAASA,cAAS,EAAE;;AAE5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,kBAAkB;AAC7B;;AAEA,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;AACxB,IAAI,OAAO,mBAAmB;AAC9B;;AAEA,EAAE,IAAI;AACN,IAAI,MAAMC,oBAAe,CAAC;AAC1B;AACA,MAAM,KAAK;AACX;AACA;AACA;AACA;AACA;AACA,QAAQ,+KAA+K;AACvL,QAAQ;AACR,UAAU,IAAI,EAAE,IAAI;AACpB,UAAU,MAAM,EAAE,MAAM;AACxB,UAAU,IAAI,EAAE,MAAM;AACtB,UAAU,WAAW,EAAE,MAAM;AAC7B,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,MAAM;AACV,IAAI,OAAO,oBAAoB;AAC/B;AACA;;;;"}
@@ -28,24 +28,22 @@ class BrowserClient extends Client {
28
28
 
29
29
  super(opts);
30
30
 
31
- const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;
32
- // eslint-disable-next-line deprecation/deprecation
33
- const shouldEnableLogs = enableLogs ?? _experiments?.enableLogs;
31
+ const { sendDefaultPii, sendClientReports, enableLogs } = this._options;
34
32
 
35
- if (WINDOW.document && (sendClientReports || shouldEnableLogs)) {
33
+ if (WINDOW.document && (sendClientReports || enableLogs)) {
36
34
  WINDOW.document.addEventListener('visibilitychange', () => {
37
35
  if (WINDOW.document.visibilityState === 'hidden') {
38
36
  if (sendClientReports) {
39
37
  this._flushOutcomes();
40
38
  }
41
- if (shouldEnableLogs) {
39
+ if (enableLogs) {
42
40
  _INTERNAL_flushLogsBuffer(this);
43
41
  }
44
42
  }
45
43
  });
46
44
  }
47
45
 
48
- if (shouldEnableLogs) {
46
+ if (enableLogs) {
49
47
  this.on('flush', () => {
50
48
  _INTERNAL_flushLogsBuffer(this);
51
49
  });
@@ -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,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n addAutoIpAddressToSession,\n addAutoIpAddressToUser,\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 * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = Options<BrowserTransportOptions> &\n BrowserSpecificOptions & {\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/**\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 super(opts);\n\n const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;\n // eslint-disable-next-line deprecation/deprecation\n const shouldEnableLogs = enableLogs ?? _experiments?.enableLogs;\n\n if (WINDOW.document && (sendClientReports || shouldEnableLogs)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (shouldEnableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n }\n });\n }\n\n if (shouldEnableLogs) {\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('postprocessEvent', addAutoIpAddressToUser);\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,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ACA;;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;;;;"}
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,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n addAutoIpAddressToSession,\n addAutoIpAddressToUser,\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 * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = Options<BrowserTransportOptions> &\n BrowserSpecificOptions & {\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/**\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 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('postprocessEvent', addAutoIpAddressToUser);\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":";;;;AAuBA;AACA;AACA;;AAGA,MAAM,sBAAA,GAAyB,IAAI;;AAuCnC;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAA,SAAsB,MAAM,CAAuB;;AAEhE;AACA;AACA;AACA;AACA;AACA,GAAS,WAAW,CAAC,OAAO,EAAwB;AACpD,IAAI,MAAM,IAAA,GAAO,mBAAmB,CAAC,OAAO,CAAC;AAC7C,IAAI,MAAM,YAAY,MAAM,CAAC,iBAAA,IAAqB,YAAY,EAAE;AAChE,IAAI,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;;AAE7D,IAAI,KAAK,CAAC,IAAI,CAAC;;AAEf,IAAI,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAA,EAAW,GAAI,IAAI,CAAC,QAAQ;;AAE3E,IAAI,IAAI,MAAM,CAAC,QAAA,KAAa,iBAAA,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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;;;;"}
@@ -1,4 +1,4 @@
1
- import { getClient } from '@sentry/core';
1
+ import { getClient, suppressTracing } from '@sentry/core';
2
2
 
3
3
  /**
4
4
  * A function to diagnose why the SDK might not be successfully sending data.
@@ -23,20 +23,22 @@ async function diagnoseSdkConnectivity()
23
23
  }
24
24
 
25
25
  try {
26
- // If fetch throws, there is likely an ad blocker active or there are other connective issues.
27
- await fetch(
28
- // We are using the
29
- // - "sentry-sdks" org with id 447951 not to pollute any actual organizations.
30
- // - "diagnose-sdk-connectivity" project with id 4509632503087104
31
- // - the public key of said org/project, which is disabled in the project settings
32
- // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)
33
- 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',
34
- {
35
- body: '{}',
36
- method: 'POST',
37
- mode: 'cors',
38
- credentials: 'omit',
39
- },
26
+ await suppressTracing(() =>
27
+ // If fetch throws, there is likely an ad blocker active or there are other connective issues.
28
+ fetch(
29
+ // We are using the
30
+ // - "sentry-sdks" org with id 447951 not to pollute any actual organizations.
31
+ // - "diagnose-sdk-connectivity" project with id 4509632503087104
32
+ // - the public key of said org/project, which is disabled in the project settings
33
+ // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)
34
+ 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',
35
+ {
36
+ body: '{}',
37
+ method: 'POST',
38
+ mode: 'cors',
39
+ credentials: 'omit',
40
+ },
41
+ ),
40
42
  );
41
43
  } catch {
42
44
  return 'sentry-unreachable';
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose-sdk.js","sources":["../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient } from '@sentry/core';\n\n/**\n * A function to diagnose why the SDK might not be successfully sending data.\n *\n * Possible return values wrapped in a Promise:\n * - `\"no-client-active\"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.\n * - `\"sentry-unreachable\"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.\n *\n * If the function doesn't detect an issue it resolves to `undefined`.\n */\nexport async function diagnoseSdkConnectivity(): Promise<\n 'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void\n> {\n const client = getClient();\n\n if (!client) {\n return 'no-client-active';\n }\n\n if (!client.getDsn()) {\n return 'no-dsn-configured';\n }\n\n try {\n // If fetch throws, there is likely an ad blocker active or there are other connective issues.\n await fetch(\n // We are using the\n // - \"sentry-sdks\" org with id 447951 not to pollute any actual organizations.\n // - \"diagnose-sdk-connectivity\" project with id 4509632503087104\n // - the public key of said org/project, which is disabled in the project settings\n // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)\n 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',\n {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n },\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,uBAAuB;;AAE7C,CAAE;AACF,EAAE,MAAM,MAAA,GAAS,SAAS,EAAE;;AAE5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,kBAAkB;AAC7B;;AAEA,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;AACxB,IAAI,OAAO,mBAAmB;AAC9B;;AAEA,EAAE,IAAI;AACN;AACA,IAAI,MAAM,KAAK;AACf;AACA;AACA;AACA;AACA;AACA,MAAM,+KAA+K;AACrL,MAAM;AACN,QAAQ,IAAI,EAAE,IAAI;AAClB,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,IAAI,EAAE,MAAM;AACpB,QAAQ,WAAW,EAAE,MAAM;AAC3B,OAAO;AACP,KAAK;AACL,IAAI,MAAM;AACV,IAAI,OAAO,oBAAoB;AAC/B;AACA;;;;"}
1
+ {"version":3,"file":"diagnose-sdk.js","sources":["../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient, suppressTracing } from '@sentry/core';\n\n/**\n * A function to diagnose why the SDK might not be successfully sending data.\n *\n * Possible return values wrapped in a Promise:\n * - `\"no-client-active\"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.\n * - `\"sentry-unreachable\"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.\n *\n * If the function doesn't detect an issue it resolves to `undefined`.\n */\nexport async function diagnoseSdkConnectivity(): Promise<\n 'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void\n> {\n const client = getClient();\n\n if (!client) {\n return 'no-client-active';\n }\n\n if (!client.getDsn()) {\n return 'no-dsn-configured';\n }\n\n try {\n await suppressTracing(() =>\n // If fetch throws, there is likely an ad blocker active or there are other connective issues.\n fetch(\n // We are using the\n // - \"sentry-sdks\" org with id 447951 not to pollute any actual organizations.\n // - \"diagnose-sdk-connectivity\" project with id 4509632503087104\n // - the public key of said org/project, which is disabled in the project settings\n // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)\n 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',\n {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n },\n ),\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,uBAAuB;;AAE7C,CAAE;AACF,EAAE,MAAM,MAAA,GAAS,SAAS,EAAE;;AAE5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,kBAAkB;AAC7B;;AAEA,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;AACxB,IAAI,OAAO,mBAAmB;AAC9B;;AAEA,EAAE,IAAI;AACN,IAAI,MAAM,eAAe,CAAC;AAC1B;AACA,MAAM,KAAK;AACX;AACA;AACA;AACA;AACA;AACA,QAAQ,+KAA+K;AACvL,QAAQ;AACR,UAAU,IAAI,EAAE,IAAI;AACpB,UAAU,MAAM,EAAE,MAAM;AACxB,UAAU,IAAI,EAAE,MAAM;AACtB,UAAU,WAAW,EAAE,MAAM;AAC7B,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,MAAM;AACV,IAAI,OAAO,oBAAoB;AAC/B;AACA;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"9.44.2","sideEffects":false}
1
+ {"type":"module","version":"10.1.0","sideEffects":false}
@@ -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,EACP,mBAAmB,EACnB,KAAK,EACL,aAAa,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAKL,MAAM,EAEP,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AASlE,KAAK,sBAAsB,GAAG,0BAA0B,GACtD,6BAA6B,GAAG;IAC9B,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AACJ;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,GAC3D,sBAAsB,GAAG;IACvB;;;;;;;;;;;;;;;;OAgBG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAEJ;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC,uBAAuB,CAAC,GAAG,sBAAsB,CAAC;AAEnG;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,MAAM,CAAC,oBAAoB,CAAC;IAC7D,OAAO,CAAC,oBAAoB,CAA4C;IACxE;;;;OAIG;gBACgB,OAAO,EAAE,oBAAoB;IA8ChD;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAInF;;OAEG;IACI,g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BAAoB,CAA4C;IACxE;;;;OAIG;gBACgB,OAAO,EAAE,oBAAoB;IA4ChD;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAInF;;OAEG;IACI,gBAAgB,CACrB,OAAO,EAAE,mBAAmB,EAC5B,KAAK,GAAE,aAAsB,EAC7B,IAAI,CAAC,EAAE,SAAS,GACf,WAAW,CAAC,KAAK,CAAC;IAIrB;;OAEG;IACH,SAAS,CAAC,aAAa,CACrB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,KAAK,EACnB,cAAc,EAAE,KAAK,GACpB,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC;CAK7B;AAED,+BAA+B;AAC/B,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,OAAO,CAAC,oBAAoB,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAW7F"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose-sdk.d.ts","sourceRoot":"","sources":["../../../src/diagnose-sdk.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CACtD,kBAAkB,GAAG,oBAAoB,GAAG,mBAAmB,GAAG,IAAI,CACvE,CA8BA"}
1
+ {"version":3,"file":"diagnose-sdk.d.ts","sourceRoot":"","sources":["../../../src/diagnose-sdk.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CACtD,kBAAkB,GAAG,oBAAoB,GAAG,mBAAmB,GAAG,IAAI,CACvE,CAgCA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/browser",
3
- "version": "9.44.2",
3
+ "version": "10.1.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",
@@ -36,18 +36,17 @@
36
36
  }
37
37
  },
38
38
  "publishConfig": {
39
- "access": "public",
40
- "tag": "v9"
39
+ "access": "public"
41
40
  },
42
41
  "dependencies": {
43
- "@sentry-internal/browser-utils": "9.44.2",
44
- "@sentry-internal/feedback": "9.44.2",
45
- "@sentry-internal/replay": "9.44.2",
46
- "@sentry-internal/replay-canvas": "9.44.2",
47
- "@sentry/core": "9.44.2"
42
+ "@sentry-internal/browser-utils": "10.1.0",
43
+ "@sentry-internal/feedback": "10.1.0",
44
+ "@sentry-internal/replay": "10.1.0",
45
+ "@sentry-internal/replay-canvas": "10.1.0",
46
+ "@sentry/core": "10.1.0"
48
47
  },
49
48
  "devDependencies": {
50
- "@sentry-internal/integration-shims": "9.44.2",
49
+ "@sentry-internal/integration-shims": "10.1.0",
51
50
  "fake-indexeddb": "^4.0.1"
52
51
  },
53
52
  "scripts": {