File tree Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ import {
49
49
import { getEnvelopeEndpointWithUrlEncodedAuth } from './api' ;
50
50
import { DEBUG_BUILD } from './debug-build' ;
51
51
import { createEventEnvelope , createSessionEnvelope } from './envelope' ;
52
- import { getClient } from './exports' ;
53
52
import { getIsolationScope } from './hub' ;
54
53
import type { IntegrationIndex } from './integration' ;
55
54
import { afterSetupIntegrations } from './integration' ;
@@ -933,17 +932,3 @@ function isErrorEvent(event: Event): event is ErrorEvent {
933
932
function isTransactionEvent ( event : Event ) : event is TransactionEvent {
934
933
return event . type === 'transaction' ;
935
934
}
936
-
937
- /**
938
- * Add an event processor to the current client.
939
- * This event processor will run for all events processed by this client.
940
- */
941
- export function addEventProcessor ( callback : EventProcessor ) : void {
942
- const client = getClient ( ) ;
943
-
944
- if ( ! client || ! client . addEventProcessor ) {
945
- return ;
946
- }
947
-
948
- client . addEventProcessor ( callback ) ;
949
- }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import type {
7
7
CustomSamplingContext ,
8
8
Event ,
9
9
EventHint ,
10
+ EventProcessor ,
10
11
Extra ,
11
12
Extras ,
12
13
FinishedCheckIn ,
@@ -382,6 +383,15 @@ export function getCurrentScope(): Scope {
382
383
return getCurrentHub ( ) . getScope ( ) ;
383
384
}
384
385
386
+ /**
387
+ * Add an event processor.
388
+ * This will be added to the current isolation scope, ensuring any event that is processed in the current execution
389
+ * context will have the processor applied.
390
+ */
391
+ export function addEventProcessor ( callback : EventProcessor ) : void {
392
+ getIsolationScope ( ) . addEventProcessor ( callback ) ;
393
+ }
394
+
385
395
/**
386
396
* Start a session on the current isolation scope.
387
397
*
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ export {
34
34
endSession ,
35
35
captureSession ,
36
36
withActiveSpan ,
37
+ addEventProcessor ,
37
38
} from './exports' ;
38
39
export {
39
40
// eslint-disable-next-line deprecation/deprecation
@@ -58,7 +59,7 @@ export {
58
59
addGlobalEventProcessor ,
59
60
} from './eventProcessors' ;
60
61
export { getEnvelopeEndpointWithUrlEncodedAuth , getReportDialogEndpoint } from './api' ;
61
- export { BaseClient , addEventProcessor } from './baseclient' ;
62
+ export { BaseClient } from './baseclient' ;
62
63
export { ServerRuntimeClient } from './server-runtime-client' ;
63
64
export { initAndBind , setCurrentClient } from './sdk' ;
64
65
export { createTransport } from './transports/base' ;
You can’t perform that action at this time.
0 commit comments