Hi,
In the Posthog provider, we currently have this code:
if (typeof window !== "undefined") {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_API_KEY!, {
api_host: "https://app.posthog.com",
capture_pageview: true,
session_recording: {
maskAllInputs: false,
},
// Enable debug mode in development
loaded: (posthog) => {
if (process.env.NODE_ENV === "development") posthog.debug()
},
})
}
For contributors who don’t have a Posthog key (or don’t intend to add one), navigating the components page currently throws errors.
I suggest updating the code to disable Posthog initialization when the API key is not provided, to prevent these errors and improve the developer experience.
If you confirm that, I can open the pull request.