Skip to content

Commit 2483b70

Browse files
committed
chore: add analytics
1 parent 49d80f1 commit 2483b70

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"jotai-location": "^0.5.5",
2121
"lucide-react": "^0.469.0",
2222
"monaco-editor": "0.48.0",
23+
"posthog-js": "^1.205.0",
2324
"react": "^18.2.0",
2425
"react-dom": "^18.2.0",
2526
"tailwind-merge": "^2.6.0",

web/pnpm-lock.yaml

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/src/main.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ import React from "react";
22
import ReactDOM from "react-dom/client";
33
import App from "./App.tsx";
44
import "./index.css";
5+
import posthog from "posthog-js";
6+
7+
if (process.env.PUBLIC_POSTHOG_API_KEY) {
8+
posthog.init(process.env.PUBLIC_POSTHOG_API_KEY, {
9+
api_host: "https://us.i.posthog.com",
10+
person_profiles: "identified_only",
11+
});
12+
}
513

614
ReactDOM.createRoot(document.getElementById("root")!).render(
715
<React.StrictMode>

web/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default defineConfig({
1111
global: {},
1212
// importing moonshine error'd without this.
1313
"process.env.VSCODE_TEXTMATE_DEBUG": "false",
14+
"process.env.PUBLIC_POSTHOG_API_KEY": process.env.PUBLIC_POSTHOG_API_KEY,
1415
},
1516
resolve: {
1617
alias: {

0 commit comments

Comments
 (0)