export function getSentryApiUrl ( sentryDsn ? ) { if ( ! sentryDsn ) { return undefined ; } const dsnUrl = new URL ( sentryDsn ) ; const sentryKey = dsnUrl . username ; const project = dsnUrl . pathname . substr ( 1 ) ; return `https://${ encodeURIComponent ( dsnUrl . hostname ) }/api/${ encodeURIComponent ( project ) }/store/?sentry_version=7&sentry_key=${ sentryKey }` ; }