Fix issue #4939: Move PostHog client key to config.json

This commit is contained in:
openhands
2024-11-12 17:36:25 +00:00
parent 0cfb132ab7
commit 18d9acfc86
2 changed files with 10 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
{
"APP_MODE": "oss",
"GITHUB_CLIENT_ID": ""
"GITHUB_CLIENT_ID": "",
"POSTHOG_CLIENT_KEY": "phc_3ESMmY9SgqEAGBB6sMGK5ayYHkeUuknH2vP6FmWH9RA"
}

View File

@@ -15,10 +15,14 @@ import store from "./store";
function PosthogInit() {
React.useEffect(() => {
posthog.init("phc_3ESMmY9SgqEAGBB6sMGK5ayYHkeUuknH2vP6FmWH9RA", {
api_host: "https://us.i.posthog.com",
person_profiles: "identified_only",
});
fetch("/config.json")
.then((response) => response.json())
.then((config) => {
posthog.init(config.POSTHOG_CLIENT_KEY, {
api_host: "https://us.i.posthog.com",
person_profiles: "identified_only",
});
});
}, []);
return null;