sentry-initor.tsx 978 Bytes
/*
 * @Author: liimin 17653212@qq.com
 * @Date: 2025-04-16 18:17:34
 * @LastEditors: limin
 * @LastEditTime: 2025-07-25 17:36:41
 * @FilePath: \ai-assistant\app\init\sentry-initor.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
'use client'

import { useEffect } from 'react'
import * as Sentry from '@sentry/react'

const isDevelopment = process.env.NODE_ENV === 'development'
const SENTRY_DSN = 'https://90ddfaad2eac44f3b25cd4298ae7af14@sentry.glsx.com.cn/45'
const SentryInit = ({ children }: { children: React.ReactNode }) => {
  useEffect(() => {
    Sentry.init({
      dsn: SENTRY_DSN,
      integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
      tracesSampleRate: 0.1,
      replaysSessionSampleRate: 0.1,
      replaysOnErrorSampleRate: 1.0,
    })
  }, [])
  return children
}

export default SentryInit