@sentry/browser 10.18.0 → 10.20.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 +6 -21
- package/build/npm/cjs/client.js.map +1 -1
- package/build/npm/cjs/index.js +8 -2
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/cjs/integrations/featureFlags/growthbook/integration.js +29 -0
- package/build/npm/cjs/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/utils/lazyLoadIntegration.js +3 -0
- package/build/npm/cjs/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/client.js +7 -22
- package/build/npm/esm/client.js.map +1 -1
- package/build/npm/esm/index.js +2 -1
- package/build/npm/esm/index.js.map +1 -1
- package/build/npm/esm/integrations/featureFlags/growthbook/integration.js +27 -0
- package/build/npm/esm/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/package.json +1 -1
- package/build/npm/esm/utils/lazyLoadIntegration.js +3 -0
- package/build/npm/esm/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/types/client.d.ts +0 -1
- 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 +1 -0
- package/build/npm/types/helpers.d.ts.map +1 -1
- package/build/npm/types/index.d.ts +2 -1
- package/build/npm/types/index.d.ts.map +1 -1
- package/build/npm/types/integrations/featureFlags/growthbook/index.d.ts +2 -0
- package/build/npm/types/integrations/featureFlags/growthbook/index.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/growthbook/integration.d.ts +25 -0
- package/build/npm/types/integrations/featureFlags/growthbook/integration.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/growthbook/types.d.ts +6 -0
- package/build/npm/types/integrations/featureFlags/growthbook/types.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts.map +1 -0
- package/build/npm/types/utils/lazyLoadIntegration.d.ts +3 -0
- package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -1
- package/build/npm/types-ts3.8/client.d.ts +0 -1
- package/build/npm/types-ts3.8/exports.d.ts +1 -1
- package/build/npm/types-ts3.8/helpers.d.ts +1 -0
- package/build/npm/types-ts3.8/index.d.ts +2 -1
- package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/index.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/integration.d.ts +25 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/types.d.ts +6 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentanthropicaiclient.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentopenaiclient.d.ts +2 -0
- package/build/npm/types-ts3.8/utils/lazyLoadIntegration.d.ts +3 -0
- package/package.json +7 -7
package/build/npm/cjs/client.js
CHANGED
|
@@ -8,8 +8,6 @@ const helpers = require('./helpers.js');
|
|
|
8
8
|
* A magic string that build tooling can leverage in order to inject a release value into the SDK.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
const DEFAULT_FLUSH_INTERVAL = 5000;
|
|
12
|
-
|
|
13
11
|
/**
|
|
14
12
|
* The Sentry Browser SDK Client.
|
|
15
13
|
*
|
|
@@ -17,7 +15,6 @@ const DEFAULT_FLUSH_INTERVAL = 5000;
|
|
|
17
15
|
* @see SentryClient for usage documentation.
|
|
18
16
|
*/
|
|
19
17
|
class BrowserClient extends core.Client {
|
|
20
|
-
|
|
21
18
|
/**
|
|
22
19
|
* Creates a new Browser SDK instance.
|
|
23
20
|
*
|
|
@@ -39,9 +36,10 @@ class BrowserClient extends core.Client {
|
|
|
39
36
|
|
|
40
37
|
super(opts);
|
|
41
38
|
|
|
42
|
-
const { sendDefaultPii, sendClientReports, enableLogs } = this._options;
|
|
39
|
+
const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;
|
|
43
40
|
|
|
44
|
-
|
|
41
|
+
// Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)
|
|
42
|
+
if (helpers.WINDOW.document && (sendClientReports || enableLogs || _experiments?.enableMetrics)) {
|
|
45
43
|
helpers.WINDOW.document.addEventListener('visibilitychange', () => {
|
|
46
44
|
if (helpers.WINDOW.document.visibilityState === 'hidden') {
|
|
47
45
|
if (sendClientReports) {
|
|
@@ -50,26 +48,13 @@ class BrowserClient extends core.Client {
|
|
|
50
48
|
if (enableLogs) {
|
|
51
49
|
core._INTERNAL_flushLogsBuffer(this);
|
|
52
50
|
}
|
|
51
|
+
if (_experiments?.enableMetrics) {
|
|
52
|
+
core._INTERNAL_flushMetricsBuffer(this);
|
|
53
|
+
}
|
|
53
54
|
}
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
if (enableLogs) {
|
|
58
|
-
this.on('flush', () => {
|
|
59
|
-
core._INTERNAL_flushLogsBuffer(this);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
this.on('afterCaptureLog', () => {
|
|
63
|
-
if (this._logFlushIdleTimeout) {
|
|
64
|
-
clearTimeout(this._logFlushIdleTimeout);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
this._logFlushIdleTimeout = setTimeout(() => {
|
|
68
|
-
core._INTERNAL_flushLogsBuffer(this);
|
|
69
|
-
}, DEFAULT_FLUSH_INTERVAL);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
58
|
if (sendDefaultPii) {
|
|
74
59
|
this.on('beforeSendSession', core.addAutoIpAddressToSession);
|
|
75
60
|
}
|
|
@@ -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\
|
|
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\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 /**\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 // Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)\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 (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","add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GAAG;AACH;;;;;"}
|
package/build/npm/cjs/index.js
CHANGED
|
@@ -35,7 +35,8 @@ const browsersession = require('./integrations/browsersession.js');
|
|
|
35
35
|
const integration$1 = require('./integrations/featureFlags/launchdarkly/integration.js');
|
|
36
36
|
const integration$2 = require('./integrations/featureFlags/openfeature/integration.js');
|
|
37
37
|
const integration$3 = require('./integrations/featureFlags/unleash/integration.js');
|
|
38
|
-
const integration$4 = require('./integrations/featureFlags/
|
|
38
|
+
const integration$4 = require('./integrations/featureFlags/growthbook/integration.js');
|
|
39
|
+
const integration$5 = require('./integrations/featureFlags/statsig/integration.js');
|
|
39
40
|
const diagnoseSdk = require('./diagnose-sdk.js');
|
|
40
41
|
const webWorker = require('./integrations/webWorker.js');
|
|
41
42
|
|
|
@@ -81,12 +82,16 @@ exports.getSpanDescendants = core.getSpanDescendants;
|
|
|
81
82
|
exports.getSpanStatusFromHttpCode = core.getSpanStatusFromHttpCode;
|
|
82
83
|
exports.getTraceData = core.getTraceData;
|
|
83
84
|
exports.inboundFiltersIntegration = core.inboundFiltersIntegration;
|
|
85
|
+
exports.instrumentAnthropicAiClient = core.instrumentAnthropicAiClient;
|
|
86
|
+
exports.instrumentGoogleGenAIClient = core.instrumentGoogleGenAIClient;
|
|
87
|
+
exports.instrumentOpenAiClient = core.instrumentOpenAiClient;
|
|
84
88
|
exports.instrumentSupabaseClient = core.instrumentSupabaseClient;
|
|
85
89
|
exports.isEnabled = core.isEnabled;
|
|
86
90
|
exports.isInitialized = core.isInitialized;
|
|
87
91
|
exports.lastEventId = core.lastEventId;
|
|
88
92
|
exports.logger = core.logger;
|
|
89
93
|
exports.makeMultiplexedTransport = core.makeMultiplexedTransport;
|
|
94
|
+
exports.metrics = core.metrics;
|
|
90
95
|
exports.moduleMetadataIntegration = core.moduleMetadataIntegration;
|
|
91
96
|
exports.parameterize = core.parameterize;
|
|
92
97
|
exports.registerSpanErrorInstrumentation = core.registerSpanErrorInstrumentation;
|
|
@@ -166,7 +171,8 @@ exports.launchDarklyIntegration = integration$1.launchDarklyIntegration;
|
|
|
166
171
|
exports.OpenFeatureIntegrationHook = integration$2.OpenFeatureIntegrationHook;
|
|
167
172
|
exports.openFeatureIntegration = integration$2.openFeatureIntegration;
|
|
168
173
|
exports.unleashIntegration = integration$3.unleashIntegration;
|
|
169
|
-
exports.
|
|
174
|
+
exports.growthbookIntegration = integration$4.growthbookIntegration;
|
|
175
|
+
exports.statsigIntegration = integration$5.statsigIntegration;
|
|
170
176
|
exports.diagnoseSdkConnectivity = diagnoseSdk.diagnoseSdkConnectivity;
|
|
171
177
|
exports.registerWebWorker = webWorker.registerWebWorker;
|
|
172
178
|
exports.webWorkerIntegration = webWorker.webWorkerIntegration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Sentry integration for capturing feature flag evaluations from GrowthBook.
|
|
7
|
+
*
|
|
8
|
+
* See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```
|
|
12
|
+
* import { GrowthBook } from '@growthbook/growthbook';
|
|
13
|
+
* import * as Sentry from '@sentry/browser';
|
|
14
|
+
*
|
|
15
|
+
* Sentry.init({
|
|
16
|
+
* dsn: '___PUBLIC_DSN___',
|
|
17
|
+
* integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* const gb = new GrowthBook();
|
|
21
|
+
* gb.isOn('my-feature');
|
|
22
|
+
* Sentry.captureException(new Error('something went wrong'));
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
const growthbookIntegration = (({ growthbookClass }) =>
|
|
26
|
+
core.growthbookIntegration({ growthbookClass })) ;
|
|
27
|
+
|
|
28
|
+
exports.growthbookIntegration = growthbookIntegration;
|
|
29
|
+
//# sourceMappingURL=integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.js","sources":["../../../../../../src/integrations/featureFlags/growthbook/integration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { growthbookIntegration as coreGrowthbookIntegration } from '@sentry/core';\nimport type { GrowthBookClass } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from GrowthBook.\n *\n * See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags\n *\n * @example\n * ```\n * import { GrowthBook } from '@growthbook/growthbook';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],\n * });\n *\n * const gb = new GrowthBook();\n * gb.isOn('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const growthbookIntegration = (({ growthbookClass }: { growthbookClass: GrowthBookClass }) =>\n coreGrowthbookIntegration({ growthbookClass })) satisfies IntegrationFn;\n"],"names":["coreGrowthbookIntegration"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,CAAC,EAAE,eAAA,EAAiB;AAC1D,EAAEA,0BAAyB,CAAC,EAAE,eAAA,EAAiB,CAAC,CAAA;;;;"}
|
|
@@ -21,6 +21,9 @@ const LazyLoadableIntegrations = {
|
|
|
21
21
|
rewriteFramesIntegration: 'rewriteframes',
|
|
22
22
|
browserProfilingIntegration: 'browserprofiling',
|
|
23
23
|
moduleMetadataIntegration: 'modulemetadata',
|
|
24
|
+
instrumentAnthropicAiClient: 'instrumentanthropicaiclient',
|
|
25
|
+
instrumentOpenAiClient: 'instrumentopenaiclient',
|
|
26
|
+
instrumentGoogleGenAIClient: 'instrumentgooglegenaiclient',
|
|
24
27
|
} ;
|
|
25
28
|
|
|
26
29
|
const WindowWithMaybeIntegration = helpers.WINDOW
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { getClient, SDK_VERSION } from '@sentry/core';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// This is a map of integration function method to bundle file name.\nconst LazyLoadableIntegrations = {\n replayIntegration: 'replay',\n replayCanvasIntegration: 'replay-canvas',\n feedbackIntegration: 'feedback',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n captureConsoleIntegration: 'captureconsole',\n contextLinesIntegration: 'contextlines',\n linkedErrorsIntegration: 'linkederrors',\n dedupeIntegration: 'dedupe',\n extraErrorDataIntegration: 'extraerrordata',\n graphqlClientIntegration: 'graphqlclient',\n httpClientIntegration: 'httpclient',\n reportingObserverIntegration: 'reportingobserver',\n rewriteFramesIntegration: 'rewriteframes',\n browserProfilingIntegration: 'browserprofiling',\n moduleMetadataIntegration: 'modulemetadata',\n} as const;\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<keyof typeof LazyLoadableIntegrations, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: keyof typeof LazyLoadableIntegrations,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LazyLoadableIntegrations[name];\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n}\n"],"names":["WINDOW","getClient","SDK_VERSION"],"mappings":";;;;;AAKA;AACA,MAAM,2BAA2B;AACjC,EAAE,iBAAiB,EAAE,QAAQ;AAC7B,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A;AACA,EAAA,MAAA,MAAA,GAAAC,cAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,EAAA,UAAA,EAAA,EAAA,UAAA,IAAA,gCAAA;;AAEA,EAAA,OAAA,IAAA,GAAA,CAAA,CAAA,CAAA,EAAAC,gBAAA,CAAA,CAAA,EAAA,MAAA,CAAA,OAAA,CAAA,EAAA,OAAA,CAAA,CAAA,QAAA,EAAA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { getClient, SDK_VERSION } from '@sentry/core';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// This is a map of integration function method to bundle file name.\nconst LazyLoadableIntegrations = {\n replayIntegration: 'replay',\n replayCanvasIntegration: 'replay-canvas',\n feedbackIntegration: 'feedback',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n captureConsoleIntegration: 'captureconsole',\n contextLinesIntegration: 'contextlines',\n linkedErrorsIntegration: 'linkederrors',\n dedupeIntegration: 'dedupe',\n extraErrorDataIntegration: 'extraerrordata',\n graphqlClientIntegration: 'graphqlclient',\n httpClientIntegration: 'httpclient',\n reportingObserverIntegration: 'reportingobserver',\n rewriteFramesIntegration: 'rewriteframes',\n browserProfilingIntegration: 'browserprofiling',\n moduleMetadataIntegration: 'modulemetadata',\n instrumentAnthropicAiClient: 'instrumentanthropicaiclient',\n instrumentOpenAiClient: 'instrumentopenaiclient',\n instrumentGoogleGenAIClient: 'instrumentgooglegenaiclient',\n} as const;\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<keyof typeof LazyLoadableIntegrations, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: keyof typeof LazyLoadableIntegrations,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LazyLoadableIntegrations[name];\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n}\n"],"names":["WINDOW","getClient","SDK_VERSION"],"mappings":";;;;;AAKA;AACA,MAAM,2BAA2B;AACjC,EAAE,iBAAiB,EAAE,QAAQ;AAC7B,EAAE,uBAAuB,EAAE,eAAe;AAC1C,EAAE,mBAAmB,EAAE,UAAU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A,aAAA;AACA;;AAEA,SAAA,YAAA,CAAA,MAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAAC,cAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,EAAA,UAAA,EAAA,EAAA,UAAA,IAAA,gCAAA;;AAEA,EAAA,OAAA,IAAA,GAAA,CAAA,CAAA,CAAA,EAAAC,gBAAA,CAAA,CAAA,EAAA,MAAA,CAAA,OAAA,CAAA,EAAA,OAAA,CAAA,CAAA,QAAA,EAAA;AACA;;;;"}
|
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
|
|
|
@@ -6,8 +6,6 @@ import { WINDOW } from './helpers.js';
|
|
|
6
6
|
* A magic string that build tooling can leverage in order to inject a release value into the SDK.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const DEFAULT_FLUSH_INTERVAL = 5000;
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
10
|
* The Sentry Browser SDK Client.
|
|
13
11
|
*
|
|
@@ -15,7 +13,6 @@ const DEFAULT_FLUSH_INTERVAL = 5000;
|
|
|
15
13
|
* @see SentryClient for usage documentation.
|
|
16
14
|
*/
|
|
17
15
|
class BrowserClient extends Client {
|
|
18
|
-
|
|
19
16
|
/**
|
|
20
17
|
* Creates a new Browser SDK instance.
|
|
21
18
|
*
|
|
@@ -37,9 +34,10 @@ class BrowserClient extends Client {
|
|
|
37
34
|
|
|
38
35
|
super(opts);
|
|
39
36
|
|
|
40
|
-
const { sendDefaultPii, sendClientReports, enableLogs } = this._options;
|
|
37
|
+
const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;
|
|
41
38
|
|
|
42
|
-
|
|
39
|
+
// Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)
|
|
40
|
+
if (WINDOW.document && (sendClientReports || enableLogs || _experiments?.enableMetrics)) {
|
|
43
41
|
WINDOW.document.addEventListener('visibilitychange', () => {
|
|
44
42
|
if (WINDOW.document.visibilityState === 'hidden') {
|
|
45
43
|
if (sendClientReports) {
|
|
@@ -48,26 +46,13 @@ class BrowserClient extends Client {
|
|
|
48
46
|
if (enableLogs) {
|
|
49
47
|
_INTERNAL_flushLogsBuffer(this);
|
|
50
48
|
}
|
|
49
|
+
if (_experiments?.enableMetrics) {
|
|
50
|
+
_INTERNAL_flushMetricsBuffer(this);
|
|
51
|
+
}
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
if (enableLogs) {
|
|
56
|
-
this.on('flush', () => {
|
|
57
|
-
_INTERNAL_flushLogsBuffer(this);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
this.on('afterCaptureLog', () => {
|
|
61
|
-
if (this._logFlushIdleTimeout) {
|
|
62
|
-
clearTimeout(this._logFlushIdleTimeout);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
this._logFlushIdleTimeout = setTimeout(() => {
|
|
66
|
-
_INTERNAL_flushLogsBuffer(this);
|
|
67
|
-
}, DEFAULT_FLUSH_INTERVAL);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
56
|
if (sendDefaultPii) {
|
|
72
57
|
this.on('beforeSendSession', addAutoIpAddressToSession);
|
|
73
58
|
}
|
|
@@ -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\
|
|
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\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 /**\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 // Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)\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 (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":";;;;AAuBA;AACA;AACA;;AAqDA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAA,SAAsB,MAAM,CAAuB;AAChE;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,EA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;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, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, instrumentOpenAiClient, 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';
|
|
@@ -33,6 +33,7 @@ export { browserSessionIntegration } from './integrations/browsersession.js';
|
|
|
33
33
|
export { buildLaunchDarklyFlagUsedHandler, launchDarklyIntegration } from './integrations/featureFlags/launchdarkly/integration.js';
|
|
34
34
|
export { OpenFeatureIntegrationHook, openFeatureIntegration } from './integrations/featureFlags/openfeature/integration.js';
|
|
35
35
|
export { unleashIntegration } from './integrations/featureFlags/unleash/integration.js';
|
|
36
|
+
export { growthbookIntegration } from './integrations/featureFlags/growthbook/integration.js';
|
|
36
37
|
export { statsigIntegration } from './integrations/featureFlags/statsig/integration.js';
|
|
37
38
|
export { diagnoseSdkConnectivity } from './diagnose-sdk.js';
|
|
38
39
|
export { registerWebWorker, webWorkerIntegration } from './integrations/webWorker.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { growthbookIntegration as growthbookIntegration$1 } from '@sentry/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Sentry integration for capturing feature flag evaluations from GrowthBook.
|
|
5
|
+
*
|
|
6
|
+
* See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```
|
|
10
|
+
* import { GrowthBook } from '@growthbook/growthbook';
|
|
11
|
+
* import * as Sentry from '@sentry/browser';
|
|
12
|
+
*
|
|
13
|
+
* Sentry.init({
|
|
14
|
+
* dsn: '___PUBLIC_DSN___',
|
|
15
|
+
* integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const gb = new GrowthBook();
|
|
19
|
+
* gb.isOn('my-feature');
|
|
20
|
+
* Sentry.captureException(new Error('something went wrong'));
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
const growthbookIntegration = (({ growthbookClass }) =>
|
|
24
|
+
growthbookIntegration$1({ growthbookClass })) ;
|
|
25
|
+
|
|
26
|
+
export { growthbookIntegration };
|
|
27
|
+
//# sourceMappingURL=integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.js","sources":["../../../../../../src/integrations/featureFlags/growthbook/integration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { growthbookIntegration as coreGrowthbookIntegration } from '@sentry/core';\nimport type { GrowthBookClass } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from GrowthBook.\n *\n * See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags\n *\n * @example\n * ```\n * import { GrowthBook } from '@growthbook/growthbook';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],\n * });\n *\n * const gb = new GrowthBook();\n * gb.isOn('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const growthbookIntegration = (({ growthbookClass }: { growthbookClass: GrowthBookClass }) =>\n coreGrowthbookIntegration({ growthbookClass })) satisfies IntegrationFn;\n"],"names":["coreGrowthbookIntegration"],"mappings":";;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,CAAC,EAAE,eAAA,EAAiB;AAC1D,EAAEA,uBAAyB,CAAC,EAAE,eAAA,EAAiB,CAAC,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.20.0","sideEffects":false}
|
|
@@ -19,6 +19,9 @@ const LazyLoadableIntegrations = {
|
|
|
19
19
|
rewriteFramesIntegration: 'rewriteframes',
|
|
20
20
|
browserProfilingIntegration: 'browserprofiling',
|
|
21
21
|
moduleMetadataIntegration: 'modulemetadata',
|
|
22
|
+
instrumentAnthropicAiClient: 'instrumentanthropicaiclient',
|
|
23
|
+
instrumentOpenAiClient: 'instrumentopenaiclient',
|
|
24
|
+
instrumentGoogleGenAIClient: 'instrumentgooglegenaiclient',
|
|
22
25
|
} ;
|
|
23
26
|
|
|
24
27
|
const WindowWithMaybeIntegration = WINDOW
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { getClient, SDK_VERSION } from '@sentry/core';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// This is a map of integration function method to bundle file name.\nconst LazyLoadableIntegrations = {\n replayIntegration: 'replay',\n replayCanvasIntegration: 'replay-canvas',\n feedbackIntegration: 'feedback',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n captureConsoleIntegration: 'captureconsole',\n contextLinesIntegration: 'contextlines',\n linkedErrorsIntegration: 'linkederrors',\n dedupeIntegration: 'dedupe',\n extraErrorDataIntegration: 'extraerrordata',\n graphqlClientIntegration: 'graphqlclient',\n httpClientIntegration: 'httpclient',\n reportingObserverIntegration: 'reportingobserver',\n rewriteFramesIntegration: 'rewriteframes',\n browserProfilingIntegration: 'browserprofiling',\n moduleMetadataIntegration: 'modulemetadata',\n} as const;\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<keyof typeof LazyLoadableIntegrations, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: keyof typeof LazyLoadableIntegrations,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LazyLoadableIntegrations[name];\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.get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,aAAA,KAAA,UAAA,EAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,4BAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA;;AAEA,EAAA,OAAA,aAAA;AACA;;AAEA,SAAA,YAAA,CAAA,MAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,SAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,EAAA,UAAA,EAAA,EAAA,UAAA,IAAA,gCAAA;;AAEA,EAAA,OAAA,IAAA,GAAA,CAAA,CAAA,CAAA,EAAA,WAAA,CAAA,CAAA,EAAA,MAAA,CAAA,OAAA,CAAA,EAAA,OAAA,CAAA,CAAA,QAAA,EAAA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { getClient, SDK_VERSION } from '@sentry/core';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// This is a map of integration function method to bundle file name.\nconst LazyLoadableIntegrations = {\n replayIntegration: 'replay',\n replayCanvasIntegration: 'replay-canvas',\n feedbackIntegration: 'feedback',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n captureConsoleIntegration: 'captureconsole',\n contextLinesIntegration: 'contextlines',\n linkedErrorsIntegration: 'linkederrors',\n dedupeIntegration: 'dedupe',\n extraErrorDataIntegration: 'extraerrordata',\n graphqlClientIntegration: 'graphqlclient',\n httpClientIntegration: 'httpclient',\n reportingObserverIntegration: 'reportingobserver',\n rewriteFramesIntegration: 'rewriteframes',\n browserProfilingIntegration: 'browserprofiling',\n moduleMetadataIntegration: 'modulemetadata',\n instrumentAnthropicAiClient: 'instrumentanthropicaiclient',\n instrumentOpenAiClient: 'instrumentopenaiclient',\n instrumentGoogleGenAIClient: 'instrumentgooglegenaiclient',\n} as const;\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<keyof typeof LazyLoadableIntegrations, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: keyof typeof LazyLoadableIntegrations,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LazyLoadableIntegrations[name];\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n}\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A,IAAA,OAAA,aAAA,KAAA,UAAA,EAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,4BAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA;;AAEA,EAAA,OAAA,aAAA;AACA;;AAEA,SAAA,YAAA,CAAA,MAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,SAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,EAAA,UAAA,EAAA,EAAA,UAAA,IAAA,gCAAA;;AAEA,EAAA,OAAA,IAAA,GAAA,CAAA,CAAA,CAAA,EAAA,WAAA,CAAA,CAAA,EAAA,MAAA,CAAA,OAAA,CAAA,EAAA,OAAA,CAAA,CAAA,QAAA,EAAA;AACA;;;;"}
|
|
@@ -53,7 +53,6 @@ export type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & Brow
|
|
|
53
53
|
* @see SentryClient for usage documentation.
|
|
54
54
|
*/
|
|
55
55
|
export declare class BrowserClient extends Client<BrowserClientOptions> {
|
|
56
|
-
private _logFlushIdleTimeout;
|
|
57
56
|
/**
|
|
58
57
|
* Creates a new Browser SDK instance.
|
|
59
58
|
*
|
|
@@ -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,mBAAmB,EACnB,KAAK,EACL,aAAa,EACd,MAAM,cAAc,CAAC;AACtB,O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 @@
|
|
|
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,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB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BAAyB,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"}
|
|
@@ -22,6 +22,7 @@ export declare const WINDOW: {
|
|
|
22
22
|
} | undefined;
|
|
23
23
|
SENTRY_SDK_SOURCE?: import("@sentry/core").SdkSource | undefined;
|
|
24
24
|
_sentryDebugIds?: Record<string, string> | undefined;
|
|
25
|
+
_debugIds?: Record<string, string> | undefined;
|
|
25
26
|
_sentryModuleMetadata?: Record<string, any> | undefined;
|
|
26
27
|
_sentryEsmLoaderHookRegistered?: boolean | undefined;
|
|
27
28
|
_sentryInjectLoaderHookRegister?: (() => void) | undefined;
|
|
@@ -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"}
|
|
@@ -16,7 +16,7 @@ export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrow
|
|
|
16
16
|
export { reportPageLoaded } from './tracing/reportPageLoaded';
|
|
17
17
|
export { setActiveSpanInBrowser } from './tracing/setActiveSpan';
|
|
18
18
|
export type { RequestInstrumentationOptions } from './tracing/request';
|
|
19
|
-
export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, logger, } from '@sentry/core';
|
|
19
|
+
export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, instrumentAnthropicAiClient, instrumentOpenAiClient, instrumentGoogleGenAIClient, logger, } from '@sentry/core';
|
|
20
20
|
export type { Span, FeatureFlagsIntegration } from '@sentry/core';
|
|
21
21
|
export { makeBrowserOfflineTransport } from './transports/offline';
|
|
22
22
|
export { browserProfilingIntegration } from './profiling/integration';
|
|
@@ -25,6 +25,7 @@ export { browserSessionIntegration } from './integrations/browsersession';
|
|
|
25
25
|
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler } from './integrations/featureFlags/launchdarkly';
|
|
26
26
|
export { openFeatureIntegration, OpenFeatureIntegrationHook } from './integrations/featureFlags/openfeature';
|
|
27
27
|
export { unleashIntegration } from './integrations/featureFlags/unleash';
|
|
28
|
+
export { growthbookIntegration } from './integrations/featureFlags/growthbook';
|
|
28
29
|
export { statsigIntegration } from './integrations/featureFlags/statsig';
|
|
29
30
|
export { diagnoseSdkConnectivity } from './diagnose-sdk';
|
|
30
31
|
export { webWorkerIntegration, registerWebWorker } from './integrations/webWorker';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACvE,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;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E,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/growthbook/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { GrowthBookClass } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sentry integration for capturing feature flag evaluations from GrowthBook.
|
|
4
|
+
*
|
|
5
|
+
* See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* import { GrowthBook } from '@growthbook/growthbook';
|
|
10
|
+
* import * as Sentry from '@sentry/browser';
|
|
11
|
+
*
|
|
12
|
+
* Sentry.init({
|
|
13
|
+
* dsn: '___PUBLIC_DSN___',
|
|
14
|
+
* integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* const gb = new GrowthBook();
|
|
18
|
+
* gb.isOn('my-feature');
|
|
19
|
+
* Sentry.captureException(new Error('something went wrong'));
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const growthbookIntegration: ({ growthbookClass }: {
|
|
23
|
+
growthbookClass: GrowthBookClass;
|
|
24
|
+
}) => import("@sentry/core").Integration;
|
|
25
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/growthbook/integration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,qBAAqB;qBAA6C,eAAe;wCACrB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface GrowthBook {
|
|
2
|
+
isOn(this: GrowthBook, featureKey: string, ...rest: unknown[]): boolean;
|
|
3
|
+
getFeatureValue(this: GrowthBook, featureKey: string, defaultValue: unknown, ...rest: unknown[]): unknown;
|
|
4
|
+
}
|
|
5
|
+
export type GrowthBookClass = new (...args: unknown[]) => GrowthBook;
|
|
6
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/growthbook/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACxE,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;CAC3G;AAGD,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.instrumentanthropicaiclient.d.ts","sourceRoot":"","sources":["../../../../src/integrations-bundle/index.instrumentanthropicaiclient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.instrumentgooglegenaiclient.d.ts","sourceRoot":"","sources":["../../../../src/integrations-bundle/index.instrumentgooglegenaiclient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.instrumentopenaiclient.d.ts","sourceRoot":"","sources":["../../../../src/integrations-bundle/index.instrumentopenaiclient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -16,6 +16,9 @@ declare const LazyLoadableIntegrations: {
|
|
|
16
16
|
readonly rewriteFramesIntegration: "rewriteframes";
|
|
17
17
|
readonly browserProfilingIntegration: "browserprofiling";
|
|
18
18
|
readonly moduleMetadataIntegration: "modulemetadata";
|
|
19
|
+
readonly instrumentAnthropicAiClient: "instrumentanthropicaiclient";
|
|
20
|
+
readonly instrumentOpenAiClient: "instrumentopenaiclient";
|
|
21
|
+
readonly instrumentGoogleGenAIClient: "instrumentgooglegenaiclient";
|
|
19
22
|
};
|
|
20
23
|
/**
|
|
21
24
|
* Lazy load an integration from the CDN.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyLoadIntegration.d.ts","sourceRoot":"","sources":["../../../../src/utils/lazyLoadIntegration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD,QAAA,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"lazyLoadIntegration.d.ts","sourceRoot":"","sources":["../../../../src/utils/lazyLoadIntegration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;CAoBpB,CAAC;AAMX;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,OAAO,wBAAwB,EAC3C,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,aAAa,CAAC,CAwDxB"}
|
|
@@ -53,7 +53,6 @@ export type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & Brow
|
|
|
53
53
|
* @see SentryClient for usage documentation.
|
|
54
54
|
*/
|
|
55
55
|
export declare class BrowserClient extends Client<BrowserClientOptions> {
|
|
56
|
-
private _logFlushIdleTimeout;
|
|
57
56
|
/**
|
|
58
57
|
* Creates a new Browser SDK instance.
|
|
59
58
|
*
|
|
@@ -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';
|
|
@@ -22,6 +22,7 @@ export declare const WINDOW: {
|
|
|
22
22
|
} | undefined;
|
|
23
23
|
SENTRY_SDK_SOURCE?: import("@sentry/core").SdkSource | undefined;
|
|
24
24
|
_sentryDebugIds?: Record<string, string> | undefined;
|
|
25
|
+
_debugIds?: Record<string, string> | undefined;
|
|
25
26
|
_sentryModuleMetadata?: Record<string, any> | undefined;
|
|
26
27
|
_sentryEsmLoaderHookRegistered?: boolean | undefined;
|
|
27
28
|
_sentryInjectLoaderHookRegister?: (() => void) | undefined;
|
|
@@ -16,7 +16,7 @@ export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrow
|
|
|
16
16
|
export { reportPageLoaded } from './tracing/reportPageLoaded';
|
|
17
17
|
export { setActiveSpanInBrowser } from './tracing/setActiveSpan';
|
|
18
18
|
export { RequestInstrumentationOptions } from './tracing/request';
|
|
19
|
-
export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, logger, } from '@sentry/core';
|
|
19
|
+
export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, instrumentAnthropicAiClient, instrumentOpenAiClient, instrumentGoogleGenAIClient, logger, } from '@sentry/core';
|
|
20
20
|
export { Span, FeatureFlagsIntegration } from '@sentry/core';
|
|
21
21
|
export { makeBrowserOfflineTransport } from './transports/offline';
|
|
22
22
|
export { browserProfilingIntegration } from './profiling/integration';
|
|
@@ -25,6 +25,7 @@ export { browserSessionIntegration } from './integrations/browsersession';
|
|
|
25
25
|
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler } from './integrations/featureFlags/launchdarkly';
|
|
26
26
|
export { openFeatureIntegration, OpenFeatureIntegrationHook } from './integrations/featureFlags/openfeature';
|
|
27
27
|
export { unleashIntegration } from './integrations/featureFlags/unleash';
|
|
28
|
+
export { growthbookIntegration } from './integrations/featureFlags/growthbook';
|
|
28
29
|
export { statsigIntegration } from './integrations/featureFlags/statsig';
|
|
29
30
|
export { diagnoseSdkConnectivity } from './diagnose-sdk';
|
|
30
31
|
export { webWorkerIntegration, registerWebWorker } from './integrations/webWorker';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GrowthBookClass } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sentry integration for capturing feature flag evaluations from GrowthBook.
|
|
4
|
+
*
|
|
5
|
+
* See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* import { GrowthBook } from '@growthbook/growthbook';
|
|
10
|
+
* import * as Sentry from '@sentry/browser';
|
|
11
|
+
*
|
|
12
|
+
* Sentry.init({
|
|
13
|
+
* dsn: '___PUBLIC_DSN___',
|
|
14
|
+
* integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* const gb = new GrowthBook();
|
|
18
|
+
* gb.isOn('my-feature');
|
|
19
|
+
* Sentry.captureException(new Error('something went wrong'));
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const growthbookIntegration: ({ growthbookClass }: {
|
|
23
|
+
growthbookClass: GrowthBookClass;
|
|
24
|
+
}) => import("@sentry/core").Integration;
|
|
25
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface GrowthBook {
|
|
2
|
+
isOn(this: GrowthBook, featureKey: string, ...rest: unknown[]): boolean;
|
|
3
|
+
getFeatureValue(this: GrowthBook, featureKey: string, defaultValue: unknown, ...rest: unknown[]): unknown;
|
|
4
|
+
}
|
|
5
|
+
export type GrowthBookClass = new (...args: unknown[]) => GrowthBook;
|
|
6
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -16,6 +16,9 @@ declare const LazyLoadableIntegrations: {
|
|
|
16
16
|
readonly rewriteFramesIntegration: "rewriteframes";
|
|
17
17
|
readonly browserProfilingIntegration: "browserprofiling";
|
|
18
18
|
readonly moduleMetadataIntegration: "modulemetadata";
|
|
19
|
+
readonly instrumentAnthropicAiClient: "instrumentanthropicaiclient";
|
|
20
|
+
readonly instrumentOpenAiClient: "instrumentopenaiclient";
|
|
21
|
+
readonly instrumentGoogleGenAIClient: "instrumentgooglegenaiclient";
|
|
19
22
|
};
|
|
20
23
|
/**
|
|
21
24
|
* Lazy load an integration from the CDN.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/browser",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.20.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.20.0",
|
|
43
|
+
"@sentry-internal/feedback": "10.20.0",
|
|
44
|
+
"@sentry-internal/replay": "10.20.0",
|
|
45
|
+
"@sentry-internal/replay-canvas": "10.20.0",
|
|
46
|
+
"@sentry/core": "10.20.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@sentry-internal/integration-shims": "10.
|
|
49
|
+
"@sentry-internal/integration-shims": "10.20.0",
|
|
50
50
|
"fake-indexeddb": "^4.0.1"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|