File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
97
97
/** Holds flushable */
98
98
private _outcomes : { [ key : string ] : number } = { } ;
99
99
100
+ private _hooks : Record < > = { } ;
101
+
100
102
/**
101
103
* Initializes this client instance.
102
104
*
@@ -351,6 +353,8 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
351
353
}
352
354
}
353
355
356
+ public on ( ) : ( ) => void { }
357
+
354
358
/** Updates existing session based on the provided event */
355
359
protected _updateSessionFromEvent ( session : Session , event : Event ) : void {
356
360
let crashed = false ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import type { Scope } from './scope';
8
8
import type { SdkMetadata } from './sdkmetadata' ;
9
9
import type { Session , SessionAggregates } from './session' ;
10
10
import type { Severity , SeverityLevel } from './severity' ;
11
+ import type { Transaction } from './transaction' ;
11
12
import type { Transport } from './transport' ;
12
13
13
14
/**
@@ -147,4 +148,13 @@ export interface Client<O extends ClientOptions = ClientOptions> {
147
148
* @param event The dropped event.
148
149
*/
149
150
recordDroppedEvent ( reason : EventDropReason , dataCategory : DataCategory , event ?: Event ) : void ;
151
+
152
+ // HOOKS
153
+
154
+ on (
155
+ hook : 'startTransaction' | 'transactionFinish' ,
156
+ callback : ( transaction : Transaction ) => Transaction | null ,
157
+ ) : ( ) => void ;
158
+
159
+ emit ( hook : Hooks , ...params : unknown [ ] ) : void ;
150
160
}
Original file line number Diff line number Diff line change
1
+ export type Hooks = 'startTransaction' | 'transactionFinish' ;
Original file line number Diff line number Diff line change @@ -96,3 +96,4 @@ export type { WrappedFunction } from './wrappedfunction';
96
96
export type { Instrumenter } from './instrumenter' ;
97
97
98
98
export type { BrowserClientReplayOptions } from './browseroptions' ;
99
+ export type { Hooks } from './hooks' ;
You can’t perform that action at this time.
0 commit comments