Skip to content

Commit 4b966c2

Browse files
authored
Merge pull request #252 from YAPP-Github/main
M2D
2 parents bb1c2c3 + ae3649a commit 4b966c2

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

sentry.edge.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as Sentry from '@sentry/nextjs';
22

3-
const isProductionDomain = process.env.VERCEL_ENV === 'production';
3+
const isProduction = process.env.NODE_ENV === 'production';
44

5-
if (isProductionDomain) {
5+
if (isProduction) {
66
Sentry.init({
77
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
88
tracesSampleRate: 1,

sentry.server.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as Sentry from '@sentry/nextjs';
22

3-
const isProductionDomain = process.env.VERCEL_ENV === 'production';
3+
const isProduction = process.env.NODE_ENV === 'production';
44

5-
if (isProductionDomain) {
5+
if (isProduction) {
66
Sentry.init({
77
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
88
tracesSampleRate: 1,

src/instrumentation-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as Sentry from '@sentry/nextjs';
22

3-
const isProductionDomain = process.env.VERCEL_ENV === 'production';
3+
const isProduction = process.env.NODE_ENV === 'production';
44

5-
if (isProductionDomain) {
5+
if (isProduction) {
66
Sentry.init({
77
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
88
tracesSampleRate: 1,

src/lib/log.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface LogUnhandledErrorProps {
1616
url: string;
1717
}
1818

19-
const isProductionDomain = process.env.VERCEL_ENV === 'production';
19+
const isProduction = process.env.NODE_ENV === 'production';
2020

2121
export const logAPIError = ({
2222
level,
@@ -25,7 +25,7 @@ export const logAPIError = ({
2525
url,
2626
errorMessage,
2727
}: LogAPIErrorProps) => {
28-
if (!isProductionDomain) return;
28+
if (!isProduction) return;
2929

3030
Sentry.withScope((scope) => {
3131
scope.setLevel(level);
@@ -39,7 +39,7 @@ export const logAPIError = ({
3939
};
4040

4141
export const logNetworkError = ({ url }: LogNetworkErrorProps) => {
42-
if (!isProductionDomain) return;
42+
if (!isProduction) return;
4343

4444
Sentry.withScope((scope) => {
4545
scope.setLevel('warning');
@@ -51,7 +51,7 @@ export const logNetworkError = ({ url }: LogNetworkErrorProps) => {
5151
};
5252

5353
export const logUnhandledError = ({ url }: LogUnhandledErrorProps) => {
54-
if (!isProductionDomain) return;
54+
if (!isProduction) return;
5555

5656
Sentry.withScope((scope) => {
5757
scope.setLevel('fatal');

src/lib/mixpanelClient.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import mixpanel from 'mixpanel-browser';
55
const MIXPANEL_TOKEN = process.env.NEXT_PUBLIC_MIXPANEL_TOKEN;
66
const isClient = typeof window !== 'undefined';
77
const isTestEnv = process.env.NODE_ENV === 'test';
8-
const isProductionDomain = process.env.VERCEL_ENV === 'production';
8+
const isProduction = process.env.NODE_ENV === 'production';
99
let isMixpanelInitialized = false;
1010

1111
export const initMixpanel = () => {
@@ -14,7 +14,7 @@ export const initMixpanel = () => {
1414
return;
1515
}
1616

17-
if (!isMixpanelInitialized && isProductionDomain) {
17+
if (!isMixpanelInitialized && isProduction) {
1818
mixpanel.init(MIXPANEL_TOKEN, {
1919
track_pageview: false,
2020
persistence: 'localStorage',
@@ -27,15 +27,15 @@ export const initMixpanel = () => {
2727
};
2828

2929
export const startRecording = () => {
30-
if (!isClient || !isProductionDomain) {
30+
if (!isClient || !isProduction) {
3131
return;
3232
}
3333

3434
mixpanel.start_session_recording();
3535
};
3636

3737
export const stopRecording = () => {
38-
if (!isClient || !isProductionDomain) {
38+
if (!isClient || !isProduction) {
3939
return;
4040
}
4141

@@ -49,7 +49,7 @@ export const stopRecording = () => {
4949
*/
5050

5151
export const trackEvent = (event: string, properties?: Record<string, any>) => {
52-
if (!isClient || isTestEnv || !isProductionDomain) return;
52+
if (!isClient || isTestEnv || !isProduction) return;
5353

5454
if (!MIXPANEL_TOKEN) {
5555
console.warn('Mixpanel Token is missing.');
@@ -66,7 +66,7 @@ export const trackEvent = (event: string, properties?: Record<string, any>) => {
6666
* @param userId 사용자 ID
6767
*/
6868
export const identifyUser = (userId: string) => {
69-
if (!MIXPANEL_TOKEN || !isClient || !isProductionDomain) return;
69+
if (!MIXPANEL_TOKEN || !isClient || !isProduction) return;
7070

7171
try {
7272
mixpanel.identify(userId);
@@ -83,7 +83,7 @@ export const identifyUser = (userId: string) => {
8383
* @param properties 사용자 속성 데이터
8484
*/
8585
export const setUserProperties = (properties: Record<string, string>) => {
86-
if (!MIXPANEL_TOKEN || !isClient || !isProductionDomain) return;
86+
if (!MIXPANEL_TOKEN || !isClient || !isProduction) return;
8787

8888
try {
8989
mixpanel.people.set(properties);
@@ -96,7 +96,7 @@ export const setUserProperties = (properties: Record<string, string>) => {
9696
* 사용자 로그아웃 (로그아웃 시 호출)
9797
*/
9898
export const logoutUser = () => {
99-
if (!MIXPANEL_TOKEN || !isClient || !isProductionDomain) return;
99+
if (!MIXPANEL_TOKEN || !isClient || !isProduction) return;
100100

101101
try {
102102
mixpanel.reset();

0 commit comments

Comments
 (0)