sentry.py 489 B

123456789101112131415161718
  1. import sentry_sdk
  2. from sentry_sdk.integrations.typer import TyperIntegration
  3. from .auth import is_logged_in
  4. SENTRY_DSN = "https://230250605ea4b58a0b69c768e9ec1168@o4506985151856640.ingest.us.sentry.io/4508449198899200"
  5. def init_sentry() -> None:
  6. """Initialize Sentry error tracking only if user is logged in."""
  7. if not is_logged_in():
  8. return
  9. sentry_sdk.init(
  10. dsn=SENTRY_DSN,
  11. integrations=[TyperIntegration()],
  12. send_default_pii=False,
  13. )