diff --git a/frontend/src/utils/initSDK.ts b/frontend/src/utils/initSDK.ts index 03bbbffc5..98c0dd381 100644 --- a/frontend/src/utils/initSDK.ts +++ b/frontend/src/utils/initSDK.ts @@ -2,7 +2,7 @@ import mixpanel from 'mixpanel-browser'; import * as ChannelService from '@channel.io/channel-web-sdk-loader'; import * as Sentry from '@sentry/react'; -const PRODUCTION_URL = 'https://moadong.com'; +const PRODUCTION_HOSTNAMES = ['moadong.com', 'www.moadong.com']; export function initializeMixpanel() { if (import.meta.env.VITE_MIXPANEL_TOKEN) { @@ -12,7 +12,8 @@ export function initializeMixpanel() { }); } - if (!window.location.href.startsWith(PRODUCTION_URL)) { + const isProductionHost = PRODUCTION_HOSTNAMES.includes(window.location.hostname); + if (!isProductionHost) { mixpanel.disable(); } } @@ -55,4 +56,4 @@ export function initializeKakaoSDK() { } catch (error) { console.error('카카오 SDK 초기화에 실패했습니다:', error); } -} +} \ No newline at end of file