MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / init

Function init

packages/ember/addon/index.ts:28–50  ·  view source on GitHub ↗
(_runtimeConfig?: BrowserOptions)

Source from the content-addressed store, hash-verified

26 * Initialize the Sentry SDK for Ember.
27 */
28export function init(_runtimeConfig?: BrowserOptions): Client | undefined {
29 const environmentConfig = getOwnConfig<OwnConfig>().sentryConfig;
30
31 assert('Missing configuration.', environmentConfig);
32 assert('Missing configuration for Sentry.', environmentConfig.sentry || _runtimeConfig);
33
34 if (!environmentConfig.sentry) {
35 // If environment config is not specified but the above assertion passes, use runtime config.
36 environmentConfig.sentry = { ..._runtimeConfig };
37 }
38
39 // Merge runtime config into environment config, preferring runtime.
40 Object.assign(environmentConfig.sentry, _runtimeConfig || {});
41 const initConfig = Object.assign({}, environmentConfig.sentry);
42
43 applySdkMetadata(initConfig, 'ember');
44
45 // Persist Sentry init options so they are identical when performance initializers call init again.
46 const sentryInitConfig = _getSentryInitConfig();
47 Object.assign(sentryInitConfig, initConfig);
48
49 return Sentry.init(initConfig);
50}
51
52type RouteConstructor = new (...args: ConstructorParameters<typeof Route>) => Route;
53

Callers 3

tracing.test.tsFile · 0.90
fetch.test.tsFile · 0.90
sdk.test.tsFile · 0.90

Calls 4

applySdkMetadataFunction · 0.90
_getSentryInitConfigFunction · 0.85
assignMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected