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,
@@ -18,9 +16,14 @@ export async function getReplayEvent({
1816 // @ts -ignore private api
1917 const preparedEvent : Event = await client . _prepareEvent ( event , { event_id } , scope ) ;
2018
19+ // extract the SDK name because `client._prepareEvent` doesn't add it to the event
20+ const metadata = client . getOptions ( ) && client . getOptions ( ) . _metadata ;
21+ const { name } = ( metadata && metadata . sdk ) || { } ;
22+
2123 preparedEvent . sdk = {
2224 ...preparedEvent . sdk ,
23- ...REPLAY_SDK_INFO ,
25+ version : __SENTRY_REPLAY_VERSION__ ,
26+ name,
2427 } ;
2528
2629 return preparedEvent ;
You can’t perform that action at this time.
0 commit comments