-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathsdk.ts
38 lines (35 loc) · 948 Bytes
/
sdk.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { SDK_VERSION, getDefaultIntegrations, init as browserInit } from '@sentry/browser';
import type { Client } from '@sentry/core';
import { vueIntegration } from './integration';
import type { Options, TracingOptions } from './types';
/**
* Inits the Vue SDK
*/
export function init(
config: Partial<
Omit<Options, 'tracingOptions'> & {
/**
* @deprecated Add the `vueIntegration()` and pass the `tracingOptions` there instead.
*/
tracingOptions: Partial<TracingOptions>;
}
> = {},
): Client | undefined {
const options = {
_metadata: {
sdk: {
name: 'sentry.javascript.vue',
packages: [
{
name: 'npm:@sentry/vue',
version: SDK_VERSION,
},
],
version: SDK_VERSION,
},
},
defaultIntegrations: [...getDefaultIntegrations(config), vueIntegration()],
...config,
};
return browserInit(options);
}