mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 15:43:12 +00:00
feat: updated frontend use run time config inject value
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/* eslint-disable no-undef */
|
||||
import { envConfig } from "@app/config/env";
|
||||
import posthog from "posthog-js";
|
||||
|
||||
import { ENV, POSTHOG_API_KEY, POSTHOG_HOST } from "../utilities/config";
|
||||
|
||||
export const initPostHog = () => {
|
||||
// @ts-ignore
|
||||
console.log("Hi there 👋");
|
||||
try {
|
||||
if (typeof window !== "undefined") {
|
||||
// @ts-ignore
|
||||
if (ENV === "production" && TELEMETRY_CAPTURING_ENABLED === true) {
|
||||
posthog.init(POSTHOG_API_KEY, {
|
||||
api_host: POSTHOG_HOST
|
||||
if (
|
||||
envConfig.ENV === "production" &&
|
||||
envConfig.TELEMETRY_CAPTURING_ENABLED === true &&
|
||||
envConfig.POSTHOG_API_KEY
|
||||
) {
|
||||
posthog.init(envConfig.POSTHOG_API_KEY, {
|
||||
api_host: envConfig.POSTHOG_HOST
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user