mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
fix: add posthog error monitor
This commit is contained in:
@ -20,6 +20,20 @@ export function useAnalytics() {
|
||||
posthog.capture(event, properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Capture an analytic event.
|
||||
*
|
||||
* @param error The error to capture.
|
||||
* @param properties Properties to attach to the event.
|
||||
*/
|
||||
const captureException = (error: Error, properties?: Record<string, unknown>) => {
|
||||
if (!isPostHogEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
posthog.captureException(error, properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Start the session recording.
|
||||
*
|
||||
@ -53,6 +67,7 @@ export function useAnalytics() {
|
||||
|
||||
return {
|
||||
capture,
|
||||
captureException,
|
||||
startSessionRecording,
|
||||
stopSessionRecording,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user