mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-11-23 14:41:02 +00:00
14 lines
307 B
JavaScript
14 lines
307 B
JavaScript
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;
|
|
};
|