MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / init

Function init

packages/browser/src/sdk.ts:96–127  ·  view source on GitHub ↗
(options: BrowserOptions = {})

Source from the content-addressed store, hash-verified

94 * @see {@link BrowserOptions} for documentation on configuration options.
95 */
96export function init(options: BrowserOptions = {}): Client | undefined {
97 const shouldDisableBecauseIsBrowserExtenstion =
98 !options.skipBrowserExtensionCheck && checkAndWarnIfIsEmbeddedBrowserExtension();
99
100 let defaultIntegrations =
101 options.defaultIntegrations == null ? getDefaultIntegrations(options) : options.defaultIntegrations;
102
103 /*! rollup-include-development-only */
104 if (options.spotlight) {
105 if (!defaultIntegrations) {
106 defaultIntegrations = [];
107 }
108 const args = typeof options.spotlight === 'string' ? { sidecarUrl: options.spotlight } : undefined;
109 defaultIntegrations.push(spotlightBrowserIntegration(args));
110 }
111 /*! rollup-include-development-only-end */
112
113 const clientOptions: BrowserClientOptions = {
114 ...options,
115 enabled: shouldDisableBecauseIsBrowserExtenstion ? false : options.enabled,
116 stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),
117 integrations: getIntegrationsToSetup({
118 integrations: options.integrations,
119 defaultIntegrations,
120 }),
121 transport: options.transport || makeFetchTransport,
122 };
123
124 setNormalizeStringifier(normalizeStringifyValue);
125
126 return initAndBind(BrowserClient, clientOptions);
127}
128
129/**
130 * This function is here to be API compatible with the loader.

Callers 5

index.test.tsFile · 0.90
sdk.test.tsFile · 0.90
entry.jsFile · 0.90
entry.jsFile · 0.90
index.jsFile · 0.90

Calls 7

getIntegrationsToSetupFunction · 0.85
setNormalizeStringifierFunction · 0.85
initAndBindFunction · 0.85
pushMethod · 0.80
getDefaultIntegrationsFunction · 0.70

Tested by

no test coverage detected