|
|
@@ -12,15 +12,26 @@ import { Provider } from "react-redux";
|
|
|
import posthog from "posthog-js";
|
|
|
import "./i18n";
|
|
|
import store from "./store";
|
|
|
+import OpenHands from "./api/open-hands";
|
|
|
|
|
|
function PosthogInit() {
|
|
|
+ const [key, setKey] = React.useState<string | null>(null);
|
|
|
+
|
|
|
React.useEffect(() => {
|
|
|
- posthog.init("phc_3ESMmY9SgqEAGBB6sMGK5ayYHkeUuknH2vP6FmWH9RA", {
|
|
|
- api_host: "https://us.i.posthog.com",
|
|
|
- person_profiles: "identified_only",
|
|
|
+ OpenHands.getConfig().then((config) => {
|
|
|
+ setKey(config.POSTHOG_CLIENT_KEY);
|
|
|
});
|
|
|
}, []);
|
|
|
|
|
|
+ React.useEffect(() => {
|
|
|
+ if (key) {
|
|
|
+ posthog.init(key, {
|
|
|
+ api_host: "https://us.i.posthog.com",
|
|
|
+ person_profiles: "identified_only",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, [key]);
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
|