mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 06:29:37 +00:00
Add telemetry to frontend
This commit is contained in:
@@ -7,6 +7,7 @@ import { publicPaths } from "../const.js";
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import { initPostHog } from "../components/analytics/posthog";
|
||||
import { ENV } from "../components/utilities/config";
|
||||
|
||||
config.autoAddCss = false;
|
||||
|
||||
@@ -20,7 +21,7 @@ const App = ({ Component, pageProps, ...appProps }) => {
|
||||
|
||||
const handleRouteChange = () => {
|
||||
if (typeof window !== "undefined") {
|
||||
if (process.env.NEXT_PUBLIC_ENV == "production") {
|
||||
if (ENV == "production") {
|
||||
posthog.capture("$pageview");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user