Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
127 lines
3.8 KiB
Plaintext
127 lines
3.8 KiB
Plaintext
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
|
const core = require('@sentry/core');
|
|
const client = require('./client.js');
|
|
const breadcrumbs = require('./integrations/breadcrumbs.js');
|
|
const browserapierrors = require('./integrations/browserapierrors.js');
|
|
const browsersession = require('./integrations/browsersession.js');
|
|
const culturecontext = require('./integrations/culturecontext.js');
|
|
const globalhandlers = require('./integrations/globalhandlers.js');
|
|
const httpcontext = require('./integrations/httpcontext.js');
|
|
const linkederrors = require('./integrations/linkederrors.js');
|
|
const spotlight = require('./integrations/spotlight.js');
|
|
const stackParsers = require('./stack-parsers.js');
|
|
const fetch = require('./transports/fetch.js');
|
|
const detectBrowserExtension = require('./utils/detectBrowserExtension.js');
|
|
|
|
/** Get the default integrations for the browser SDK. */
|
|
function getDefaultIntegrations(_options) {
|
|
/**
|
|
* Note: Please make sure this stays in sync with Angular SDK, which re-exports
|
|
* `getDefaultIntegrations` but with an adjusted set of integrations.
|
|
*/
|
|
return [
|
|
// TODO(v11): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration`
|
|
// eslint-disable-next-line deprecation/deprecation
|
|
core.inboundFiltersIntegration(),
|
|
core.functionToStringIntegration(),
|
|
core.conversationIdIntegration(),
|
|
browserapierrors.browserApiErrorsIntegration(),
|
|
breadcrumbs.breadcrumbsIntegration(),
|
|
globalhandlers.globalHandlersIntegration(),
|
|
linkederrors.linkedErrorsIntegration(),
|
|
core.dedupeIntegration(),
|
|
httpcontext.httpContextIntegration(),
|
|
culturecontext.cultureContextIntegration(),
|
|
browsersession.browserSessionIntegration(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* The Sentry Browser SDK Client.
|
|
*
|
|
* To use this SDK, call the {@link init} function as early as possible when
|
|
* loading the web page. To set context information or send manual events, use
|
|
* the provided methods.
|
|
*
|
|
* @example
|
|
*
|
|
* ```
|
|
*
|
|
* import { init } from '@sentry/browser';
|
|
*
|
|
* init({
|
|
* dsn: '__DSN__',
|
|
* // ...
|
|
* });
|
|
* ```
|
|
*
|
|
* @example
|
|
* ```
|
|
*
|
|
* import { addBreadcrumb } from '@sentry/browser';
|
|
* addBreadcrumb({
|
|
* message: 'My Breadcrumb',
|
|
* // ...
|
|
* });
|
|
* ```
|
|
*
|
|
* @example
|
|
*
|
|
* ```
|
|
*
|
|
* import * as Sentry from '@sentry/browser';
|
|
* Sentry.captureMessage('Hello, world!');
|
|
* Sentry.captureException(new Error('Good bye'));
|
|
* Sentry.captureEvent({
|
|
* message: 'Manual',
|
|
* stacktrace: [
|
|
* // ...
|
|
* ],
|
|
* });
|
|
* ```
|
|
*
|
|
* @see {@link BrowserOptions} for documentation on configuration options.
|
|
*/
|
|
function init(options = {}) {
|
|
const shouldDisableBecauseIsBrowserExtenstion =
|
|
!options.skipBrowserExtensionCheck && detectBrowserExtension.checkAndWarnIfIsEmbeddedBrowserExtension();
|
|
|
|
let defaultIntegrations =
|
|
options.defaultIntegrations == null ? getDefaultIntegrations() : options.defaultIntegrations;
|
|
|
|
const clientOptions = {
|
|
...options,
|
|
enabled: shouldDisableBecauseIsBrowserExtenstion ? false : options.enabled,
|
|
stackParser: core.stackParserFromStackParserOptions(options.stackParser || stackParsers.defaultStackParser),
|
|
integrations: core.getIntegrationsToSetup({
|
|
integrations: options.integrations,
|
|
defaultIntegrations,
|
|
}),
|
|
transport: options.transport || fetch.makeFetchTransport,
|
|
};
|
|
return core.initAndBind(client.BrowserClient, clientOptions);
|
|
}
|
|
|
|
/**
|
|
* This function is here to be API compatible with the loader.
|
|
* @hidden
|
|
*/
|
|
function forceLoad() {
|
|
// Noop
|
|
}
|
|
|
|
/**
|
|
* This function is here to be API compatible with the loader.
|
|
* @hidden
|
|
*/
|
|
function onLoad(callback) {
|
|
callback();
|
|
}
|
|
|
|
exports.forceLoad = forceLoad;
|
|
exports.getDefaultIntegrations = getDefaultIntegrations;
|
|
exports.init = init;
|
|
exports.onLoad = onLoad;
|
|
//# sourceMappingURL=sdk.js.map
|