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
2525 */
2626export const DEFAULT_SESSION_SAMPLE_RATE = 0.1 ;
2727export 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 11import { Envelope , Event } from '@sentry/types' ;
22import { createEnvelope } from '@sentry/utils' ;
33
4- import { REPLAY_SDK_INFO } from '../constants' ;
5-
64export function createReplayEnvelope (
75 replayId : string ,
86 replayEvent : Event ,
97 payloadWithSequence : string | Uint8Array ,
108) : Envelope {
9+ const { name, version } = replayEvent . sdk || { } ;
1110 return createEnvelope (
1211 {
1312 event_id : replayId ,
1413 sent_at : new Date ( ) . toISOString ( ) ,
15- sdk : REPLAY_SDK_INFO ,
14+ sdk : { name , version } ,
1615 } ,
1716 [
1817 // @ts -ignore New types
Original file line number Diff line number Diff line change 11import { Scope } from '@sentry/core' ;
22import { Client , Event } from '@sentry/types' ;
33
4- import { REPLAY_SDK_INFO } from '../constants' ;
5-
64export async function getReplayEvent ( {
75 client,
86 scope,
@@ -24,9 +22,14 @@ export async function getReplayEvent({
2422 client . _updateSessionFromEvent ( session , preparedEvent ) ;
2523 }
2624
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+
2729 preparedEvent . sdk = {
2830 ...preparedEvent . sdk ,
29- ...REPLAY_SDK_INFO ,
31+ version : __SENTRY_REPLAY_VERSION__ ,
32+ name,
3033 } ;
3134
3235 return preparedEvent ;
You can’t perform that action at this time.
0 commit comments