diff --git a/surfsense_web/components/homepage/hero-section.tsx b/surfsense_web/components/homepage/hero-section.tsx index 7ccdd850c..64e5eb4bd 100644 --- a/surfsense_web/components/homepage/hero-section.tsx +++ b/surfsense_web/components/homepage/hero-section.tsx @@ -1,4 +1,5 @@ "use client"; +import { useFeatureFlagVariantKey } from "@posthog/react"; import { AnimatePresence, motion } from "motion/react"; import Image from "next/image"; import Link from "next/link"; @@ -33,6 +34,8 @@ const GoogleLogo = ({ className }: { className?: string }) => ( export function HeroSection() { const containerRef = useRef(null); const parentRef = useRef(null); + const heroVariant = useFeatureFlagVariantKey("notebooklm_flag"); + const isNotebookLMVariant = heroVariant === "notebooklm"; return (
- The AI Workspace{" "} -
-
- Built for Teams + {isNotebookLMVariant ? ( +
+
+ NotebookLM for Teams +
-
+ ) : ( + <> + The AI Workspace{" "} +
+
+ Built for Teams +
+
+ + )} {/* // TODO:aCTUAL DESCRITION */} @@ -96,15 +109,10 @@ export function HeroSection() { Connect any LLM to your internal knowledge sources and chat with it in real time alongside your team.

-
- - {/* - Start Free Trial - */} -
+
+ + +
+ + Contact Sales + + + ); +} + const BackgroundGrids = () => { return (
diff --git a/surfsense_web/components/providers/PostHogProvider.tsx b/surfsense_web/components/providers/PostHogProvider.tsx index 2fcca1f9d..1216730f3 100644 --- a/surfsense_web/components/providers/PostHogProvider.tsx +++ b/surfsense_web/components/providers/PostHogProvider.tsx @@ -3,6 +3,7 @@ import { PostHogProvider as PHProvider } from "@posthog/react"; import posthog from "posthog-js"; import type { ReactNode } from "react"; +import "../../instrumentation-client"; import { PostHogIdentify } from "./PostHogIdentify"; interface PostHogProviderProps { @@ -10,8 +11,8 @@ interface PostHogProviderProps { } export function PostHogProvider({ children }: PostHogProviderProps) { - // posthog-js is already initialized in instrumentation-client.ts - // We just need to wrap the app with the PostHogProvider for hook access + // posthog-js is initialized by importing instrumentation-client.ts above + // We wrap the app with the PostHogProvider for hook access return ( diff --git a/surfsense_web/instrumentation-client.ts b/surfsense_web/instrumentation-client.ts index 15f989bb4..e6b346073 100644 --- a/surfsense_web/instrumentation-client.ts +++ b/surfsense_web/instrumentation-client.ts @@ -12,5 +12,17 @@ if (process.env.NEXT_PUBLIC_POSTHOG_KEY) { capture_pageview: "history_change", // Enable session recording capture_pageleave: true, + loaded: (posthog) => { + // Expose PostHog to window for console access and toolbar + if (typeof window !== "undefined") { + window.posthog = posthog; + } + }, }); } + +// Always expose posthog to window for debugging/toolbar access +// This allows testing feature flags even without POSTHOG_KEY configured +if (typeof window !== "undefined") { + window.posthog = posthog; +} diff --git a/surfsense_web/types/window.d.ts b/surfsense_web/types/window.d.ts new file mode 100644 index 000000000..fcb6878e3 --- /dev/null +++ b/surfsense_web/types/window.d.ts @@ -0,0 +1,9 @@ +import type { PostHog } from "posthog-js"; + +declare global { + interface Window { + posthog?: PostHog; + } +} + +export {};