Skip to content

Commit

Permalink
fix(dashboard): sessions initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy committed Dec 25, 2024
1 parent 5980073 commit 7d408f6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/dashboard/src/utils/segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AnalyticsBrowser } from '@segment/analytics-next';
import type { IUserEntity } from '@novu/shared';
import * as mixpanel from 'mixpanel-browser';
import { MIXPANEL_KEY, SEGMENT_KEY } from '@/config';

import * as Sentry from '@sentry/react';
export class SegmentService {
private _segment: AnalyticsBrowser | null = null;
private _segmentEnabled: boolean;
Expand All @@ -17,6 +17,14 @@ export class SegmentService {
//@ts-expect-error missing from types
record_sessions_percent: 100,
});

try {
//@ts-expect-error missing from types
mixpanel.start_session_recording();
} catch (e) {
Sentry.captureException(e);
console.error(e);
}
}

if (this._segmentEnabled) {
Expand Down

0 comments on commit 7d408f6

Please sign in to comment.