mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 11:27:47 +00:00
Add logs for posthog in frontend
This commit is contained in:
@@ -5,14 +5,21 @@ import posthog from 'posthog-js';
|
|||||||
import { ENV, POSTHOG_API_KEY, POSTHOG_HOST } from '../utilities/config';
|
import { ENV, POSTHOG_API_KEY, POSTHOG_HOST } from '../utilities/config';
|
||||||
|
|
||||||
export const initPostHog = () => {
|
export const initPostHog = () => {
|
||||||
if (typeof window !== 'undefined') {
|
try {
|
||||||
// @ts-ignore
|
if (typeof window !== 'undefined') {
|
||||||
if (ENV == 'production' && TELEMETRY_CAPTURING_ENABLED) {
|
// @ts-ignore
|
||||||
posthog.init(POSTHOG_API_KEY, {
|
if (ENV == 'production' && TELEMETRY_CAPTURING_ENABLED) {
|
||||||
api_host: POSTHOG_HOST
|
console.log("Outside of posthog", "POSTHOG_API_KEY", POSTHOG_API_KEY, "POSTHOG_HOST", POSTHOG_HOST)
|
||||||
});
|
posthog.init(POSTHOG_API_KEY, {
|
||||||
}
|
api_host: POSTHOG_HOST
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return posthog;
|
console.log("Outside of posthog")
|
||||||
|
}
|
||||||
|
|
||||||
|
return posthog;
|
||||||
|
} catch (e) {
|
||||||
|
console.log("posthog err", e)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user