Skip to content

Commit 09a9080

Browse files
committed
[TOOL-4673] Dashboard: Enable posthog session recording for nebula app
1 parent 810ec6e commit 09a9080

File tree

7 files changed

+16
-17
lines changed

7 files changed

+16
-17
lines changed

apps/dashboard/src/app/(app)/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default function RootLayout({
6363
/>
6464
<PosthogHeadSetup />
6565
</head>
66-
<PHProvider>
66+
<PHProvider disable_session_recording={true}>
6767
<PostHogPageView />
6868
<body
6969
className={cn(

apps/dashboard/src/app/bridge/components/client/Providers.client.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ThirdwebProvider } from "thirdweb/react";
55
import { PHProvider } from "../../../../lib/posthog/Posthog";
66
import { PostHogPageView } from "../../../../lib/posthog/PosthogPageView";
77

8-
export function Providers({ children }: { children: React.ReactNode }) {
8+
export function BridgeProviders({ children }: { children: React.ReactNode }) {
99
return (
1010
<ThirdwebProvider>
1111
<ThemeProvider
@@ -14,7 +14,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
1414
enableSystem={false}
1515
defaultTheme="dark"
1616
>
17-
<PHProvider>
17+
<PHProvider disable_session_recording={true}>
1818
<PostHogPageView />
1919
{children}
2020
<Toaster richColors theme="dark" />

apps/dashboard/src/app/bridge/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { cn } from "@/lib/utils";
22
import { Inter } from "next/font/google";
33
import "../../global.css";
4-
import { Providers } from "./components/client/Providers.client";
4+
import { BridgeProviders } from "./components/client/Providers.client";
55

66
const fontSans = Inter({
77
subsets: ["latin"],
@@ -22,7 +22,7 @@ export default function BridgeLayout({
2222
fontSans.variable,
2323
)}
2424
>
25-
<Providers>{children}</Providers>
25+
<BridgeProviders>{children}</BridgeProviders>
2626
</body>
2727
</html>
2828
);

apps/dashboard/src/app/nebula-app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function Layout(props: {
3939
<link rel="icon" href="/assets/nebula/favicon.ico" />
4040
<PosthogHeadSetup />
4141
</head>
42-
<PHProvider>
42+
<PHProvider disable_session_recording={false}>
4343
<PostHogPageView />
4444
<body
4545
className={cn(

apps/dashboard/src/app/pay/components/client/Providers.client.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { ThirdwebProvider } from "thirdweb/react";
44
import { PHProvider } from "../../../../lib/posthog/Posthog";
55
import { PostHogPageView } from "../../../../lib/posthog/PosthogPageView";
66

7-
export function Providers({ children }: { children: React.ReactNode }) {
7+
export function PayProviders({ children }: { children: React.ReactNode }) {
88
return (
99
<ThirdwebProvider>
10-
<PHProvider>
10+
<PHProvider disable_session_recording={true}>
1111
<PostHogPageView />
1212
{children}
1313
<Toaster richColors theme="dark" />

apps/dashboard/src/app/pay/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import "../../global.css";
22
import { cn } from "@/lib/utils";
33
import { ThemeProvider } from "next-themes";
44
import { Inter } from "next/font/google";
5-
import { Providers } from "./components/client/Providers.client";
5+
import { PayProviders } from "./components/client/Providers.client";
66

77
const fontSans = Inter({
88
subsets: ["latin"],
@@ -23,7 +23,7 @@ export default async function PayLayout({
2323
fontSans.variable,
2424
)}
2525
>
26-
<Providers>
26+
<PayProviders>
2727
<ThemeProvider
2828
attribute="class"
2929
disableTransitionOnChange
@@ -43,7 +43,7 @@ export default async function PayLayout({
4343
/>
4444
</div>
4545
</ThemeProvider>
46-
</Providers>
46+
</PayProviders>
4747
</body>
4848
</html>
4949
);

apps/dashboard/src/lib/posthog/Posthog.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import { useEffect } from "react";
77

88
const NEXT_PUBLIC_POSTHOG_API_KEY = process.env.NEXT_PUBLIC_POSTHOG_API_KEY;
99

10-
export function PHProvider({
11-
children,
12-
}: {
10+
export function PHProvider(props: {
1311
children: React.ReactNode;
12+
disable_session_recording: boolean;
1413
}) {
1514
// eslint-disable-next-line no-restricted-syntax
1615
useEffect(() => {
@@ -19,10 +18,10 @@ export function PHProvider({
1918
api_host: "https://a.thirdweb.com",
2019
capture_pageview: false,
2120
debug: false,
22-
disable_session_recording: true,
21+
disable_session_recording: props.disable_session_recording,
2322
});
2423
}
25-
}, []);
24+
}, [props.disable_session_recording]);
2625

27-
return <PostHogProvider client={posthog}>{children}</PostHogProvider>;
26+
return <PostHogProvider client={posthog}>{props.children}</PostHogProvider>;
2827
}

0 commit comments

Comments
 (0)