File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,3 @@ export const MAX_SESSION_LIFE = 1_800_000; // 30 minutes
25
25
*/
26
26
export const DEFAULT_SESSION_SAMPLE_RATE = 0.1 ;
27
27
export const DEFAULT_ERROR_SAMPLE_RATE = 1.0 ;
28
-
29
- export const REPLAY_SDK_INFO = {
30
- name : 'sentry.javascript.integration.replay' ,
31
- version : __SENTRY_REPLAY_VERSION__ ,
32
- } ;
Original file line number Diff line number Diff line change 1
1
import { Envelope , Event } from '@sentry/types' ;
2
2
import { createEnvelope } from '@sentry/utils' ;
3
3
4
- import { REPLAY_SDK_INFO } from '../constants' ;
5
-
6
4
export function createReplayEnvelope (
7
5
replayId : string ,
8
6
replayEvent : Event ,
9
7
payloadWithSequence : string | Uint8Array ,
10
8
) : Envelope {
9
+ const { name, version } = replayEvent . sdk || { } ;
11
10
return createEnvelope (
12
11
{
13
12
event_id : replayId ,
14
13
sent_at : new Date ( ) . toISOString ( ) ,
15
- sdk : REPLAY_SDK_INFO ,
14
+ sdk : { name , version } ,
16
15
} ,
17
16
[
18
17
// @ts -ignore New types
Original file line number Diff line number Diff line change 1
1
import { Scope } from '@sentry/core' ;
2
2
import { Client , Event } from '@sentry/types' ;
3
3
4
- import { REPLAY_SDK_INFO } from '../constants' ;
5
-
6
4
export async function getReplayEvent ( {
7
5
client,
8
6
scope,
@@ -24,9 +22,14 @@ export async function getReplayEvent({
24
22
client . _updateSessionFromEvent ( session , preparedEvent ) ;
25
23
}
26
24
25
+ // extract the SDK name because `client._prepareEvent` doesn't add it to the event
26
+ const metadata = client . getOptions ( ) && client . getOptions ( ) . _metadata ;
27
+ const { name } = ( metadata && metadata . sdk ) || { } ;
28
+
27
29
preparedEvent . sdk = {
28
30
...preparedEvent . sdk ,
29
- ...REPLAY_SDK_INFO ,
31
+ version : __SENTRY_REPLAY_VERSION__ ,
32
+ name,
30
33
} ;
31
34
32
35
return preparedEvent ;
You can’t perform that action at this time.
0 commit comments