Skip to content

[TOOL-4673] Dashboard: Enable posthog session recording for nebula app #7267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function RootLayout({
/>
<PosthogHeadSetup />
</head>
<PHProvider>
<PHProvider disable_session_recording={true}>
<PostHogPageView />
<body
className={cn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ThirdwebProvider } from "thirdweb/react";
import { PHProvider } from "../../../../lib/posthog/Posthog";
import { PostHogPageView } from "../../../../lib/posthog/PosthogPageView";

export function Providers({ children }: { children: React.ReactNode }) {
export function BridgeProviders({ children }: { children: React.ReactNode }) {
return (
<ThirdwebProvider>
<ThemeProvider
Expand All @@ -14,7 +14,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
enableSystem={false}
defaultTheme="dark"
>
<PHProvider>
<PHProvider disable_session_recording={true}>
<PostHogPageView />
{children}
<Toaster richColors theme="dark" />
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/app/bridge/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cn } from "@/lib/utils";
import { Inter } from "next/font/google";
import "../../global.css";
import { Providers } from "./components/client/Providers.client";
import { BridgeProviders } from "./components/client/Providers.client";

const fontSans = Inter({
subsets: ["latin"],
Expand All @@ -22,7 +22,7 @@ export default function BridgeLayout({
fontSans.variable,
)}
>
<Providers>{children}</Providers>
<BridgeProviders>{children}</BridgeProviders>
</body>
</html>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/nebula-app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function Layout(props: {
<link rel="icon" href="/assets/nebula/favicon.ico" />
<PosthogHeadSetup />
</head>
<PHProvider>
<PHProvider disable_session_recording={false}>
<PostHogPageView />
<body
className={cn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { ThirdwebProvider } from "thirdweb/react";
import { PHProvider } from "../../../../lib/posthog/Posthog";
import { PostHogPageView } from "../../../../lib/posthog/PosthogPageView";

export function Providers({ children }: { children: React.ReactNode }) {
export function PayProviders({ children }: { children: React.ReactNode }) {
return (
<ThirdwebProvider>
<PHProvider>
<PHProvider disable_session_recording={true}>
<PostHogPageView />
{children}
<Toaster richColors theme="dark" />
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/src/app/pay/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "../../global.css";
import { cn } from "@/lib/utils";
import { ThemeProvider } from "next-themes";
import { Inter } from "next/font/google";
import { Providers } from "./components/client/Providers.client";
import { PayProviders } from "./components/client/Providers.client";

const fontSans = Inter({
subsets: ["latin"],
Expand All @@ -23,7 +23,7 @@ export default async function PayLayout({
fontSans.variable,
)}
>
<Providers>
<PayProviders>
<ThemeProvider
attribute="class"
disableTransitionOnChange
Expand All @@ -43,7 +43,7 @@ export default async function PayLayout({
/>
</div>
</ThemeProvider>
</Providers>
</PayProviders>
</body>
</html>
);
Expand Down
11 changes: 5 additions & 6 deletions apps/dashboard/src/lib/posthog/Posthog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import { useEffect } from "react";

const NEXT_PUBLIC_POSTHOG_API_KEY = process.env.NEXT_PUBLIC_POSTHOG_API_KEY;

export function PHProvider({
children,
}: {
export function PHProvider(props: {
children: React.ReactNode;
disable_session_recording: boolean;
}) {
// eslint-disable-next-line no-restricted-syntax
useEffect(() => {
Expand All @@ -19,10 +18,10 @@ export function PHProvider({
api_host: "https://a.thirdweb.com",
capture_pageview: false,
debug: false,
disable_session_recording: true,
disable_session_recording: props.disable_session_recording,
});
}
}, []);
}, [props.disable_session_recording]);

return <PostHogProvider client={posthog}>{children}</PostHogProvider>;
return <PostHogProvider client={posthog}>{props.children}</PostHogProvider>;
}
Loading