feat: setup posthog

This commit is contained in:
Nathnael
2026-07-16 08:52:29 +00:00
parent 6dde17fa4d
commit 318af79962
19 changed files with 513 additions and 190 deletions

View File

@@ -1,5 +1,7 @@
import React, { Component, ErrorInfo, ReactNode } from "react";
import { captureException } from "@/lib/posthog";
interface ErrorBoundaryProps {
children: ReactNode;
}
@@ -20,7 +22,8 @@ export class ErrorBoundary extends Component<
}
componentDidCatch(error: Error, info: ErrorInfo) {
// Log to console in development; replace with a reporting service (e.g. Sentry) in production
captureException(error, { componentStack: info.componentStack });
if (import.meta.env.DEV) {
console.error("ErrorBoundary caught:", error, info.componentStack);
}