-
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathdefault.ts
More file actions
48 lines (41 loc) · 1.75 KB
/
default.ts
File metadata and controls
48 lines (41 loc) · 1.75 KB
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
39
40
41
42
43
44
45
46
47
48
import { breadcrumbsIntegration, browserApiErrorsIntegration, browserSessionIntegration, globalHandlersIntegration } from '@sentry/browser';
import { type Integration,dedupeIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration } from '@sentry/core';
import type { CapacitorOptions } from '../options';
import { deviceContextIntegration } from './devicecontext';
import { eventOriginIntegration } from './eventorigin';
import { nativeReleaseIntegration } from './release';
import { capacitorRewriteFramesIntegration } from './rewriteframes';
import { sdkInfoIntegration } from './sdkinfo';
/**
* Returns the default Capacitor integrations based on the current environment.
*/
export function getDefaultIntegrations(
options: CapacitorOptions,
): Integration[] {
const integrations: Integration[] = [];
integrations.push(capacitorRewriteFramesIntegration());
integrations.push(nativeReleaseIntegration());
integrations.push(eventOriginIntegration());
integrations.push(sdkInfoIntegration());
if (options.enableNative) {
integrations.push(deviceContextIntegration());
}
// @sentry/browser integrations
integrations.push(
// eslint-disable-next-line deprecation/deprecation
inboundFiltersIntegration(),
functionToStringIntegration(),
browserApiErrorsIntegration(),
breadcrumbsIntegration(),
globalHandlersIntegration(),
linkedErrorsIntegration(),
dedupeIntegration(),
);
if (options.enableAutoSessionTracking && !options.enableNative) {
integrations.push(browserSessionIntegration());
}
// end @sentry/browser integrations
// @sentry/vue integrations must be added manually.
// @sentry/react, @sentry/angular @sentry/nuxt dont require any integrations.
return integrations;
}