11/* eslint-disable max-lines, complexity */
22import type { IdleTransaction } from '@sentry/core' ;
3- import { getClient } from '@sentry/core' ;
43import { defineIntegration , getCurrentHub } from '@sentry/core' ;
54import {
65 SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ,
@@ -11,6 +10,7 @@ import {
1110 startIdleTransaction ,
1211} from '@sentry/core' ;
1312import type {
13+ Client ,
1414 IntegrationFn ,
1515 StartSpanOptions ,
1616 Transaction ,
@@ -334,7 +334,7 @@ export const _browserTracingIntegration = ((_options: Partial<BrowserTracingOpti
334334 origin : 'auto.pageload.browser' ,
335335 metadata : { source : 'url' } ,
336336 } ;
337- startBrowserTracingPageLoadSpan ( context ) ;
337+ startBrowserTracingPageLoadSpan ( client , context ) ;
338338 }
339339
340340 if ( options . instrumentNavigation && client . emit ) {
@@ -362,7 +362,7 @@ export const _browserTracingIntegration = ((_options: Partial<BrowserTracingOpti
362362 metadata : { source : 'url' } ,
363363 } ;
364364
365- startBrowserTracingNavigationSpan ( context ) ;
365+ startBrowserTracingNavigationSpan ( client , context ) ;
366366 }
367367 } ) ;
368368 }
@@ -395,8 +395,8 @@ export const browserTracingIntegration = defineIntegration(_browserTracingIntegr
395395 * Manually start a page load span.
396396 * This will only do something if the BrowserTracing integration has been setup.
397397 */
398- export function startBrowserTracingPageLoadSpan ( spanOptions : StartSpanOptions , client = getClient ( ) ) : void {
399- if ( ! client || ! client . emit ) {
398+ export function startBrowserTracingPageLoadSpan ( client : Client , spanOptions : StartSpanOptions ) : void {
399+ if ( ! client . emit ) {
400400 return ;
401401 }
402402
@@ -407,8 +407,8 @@ export function startBrowserTracingPageLoadSpan(spanOptions: StartSpanOptions, c
407407 * Manually start a navigation span.
408408 * This will only do something if the BrowserTracing integration has been setup.
409409 */
410- export function startBrowserTracingNavigationSpan ( spanOptions : StartSpanOptions , client = getClient ( ) ) : void {
411- if ( ! client || ! client . emit ) {
410+ export function startBrowserTracingNavigationSpan ( client : Client , spanOptions : StartSpanOptions ) : void {
411+ if ( ! client . emit ) {
412412 return ;
413413 }
414414
0 commit comments