mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Add frontend, backend and CLI
This commit is contained in:
13
frontend/components/analytics/posthog.js
Normal file
13
frontend/components/analytics/posthog.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import posthog from "posthog-js";
|
||||
|
||||
export const initPostHog = () => {
|
||||
if (typeof window !== "undefined") {
|
||||
if (process.env.NEXT_PUBLIC_ENV == "production") {
|
||||
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_API_KEY, {
|
||||
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return posthog;
|
||||
};
|
||||
Reference in New Issue
Block a user