(options: BrowserOptions = {})
| 94 | * @see {@link BrowserOptions} for documentation on configuration options. |
| 95 | */ |
| 96 | export 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. |
no test coverage detected