1
- import { convertIntegrationFnToClass , getCurrentScope } from '@sentry/core' ;
1
+ import { convertIntegrationFnToClass , defineIntegration , getCurrentScope } from '@sentry/core' ;
2
2
import type { Client , EventEnvelope , Integration , IntegrationClass , IntegrationFn , Transaction } from '@sentry/types' ;
3
3
import type { Profile } from '@sentry/types/src/profiling' ;
4
4
import { logger } from '@sentry/utils' ;
@@ -18,7 +18,7 @@ import {
18
18
19
19
const INTEGRATION_NAME = 'BrowserProfiling' ;
20
20
21
- const browserProfilingIntegration = ( ( ) => {
21
+ const _browserProfilingIntegration = ( ( ) => {
22
22
return {
23
23
name : INTEGRATION_NAME ,
24
24
// TODO v8: Remove this
@@ -102,6 +102,8 @@ const browserProfilingIntegration = (() => {
102
102
} ;
103
103
} ) satisfies IntegrationFn ;
104
104
105
+ export const browserProfilingIntegration = defineIntegration ( _browserProfilingIntegration ) ;
106
+
105
107
/**
106
108
* Browser profiling integration. Stores any event that has contexts["profile"]["profile_id"]
107
109
* This exists because we do not want to await async profiler.stop calls as transaction.finish is called
@@ -110,9 +112,13 @@ const browserProfilingIntegration = (() => {
110
112
* integration less reliable as we might be dropping profiles when the cache is full.
111
113
*
112
114
* @experimental
115
+ * @deprecated Use `browserProfilingIntegration()` instead.
113
116
*/
114
117
// eslint-disable-next-line deprecation/deprecation
115
118
export const BrowserProfilingIntegration = convertIntegrationFnToClass (
116
119
INTEGRATION_NAME ,
117
120
browserProfilingIntegration ,
118
121
) as IntegrationClass < Integration & { setup : ( client : Client ) => void } > ;
122
+
123
+ // eslint-disable-next-line deprecation/deprecation
124
+ export type BrowserProfilingIntegration = typeof BrowserProfilingIntegration ;
0 commit comments