diff --git a/bun.lockb b/bun.lockb
index f957425..a832f73 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index 8ac5079..c115dc9 100644
--- a/package.json
+++ b/package.json
@@ -26,6 +26,7 @@
"mapkit-react": "^1.14.1",
"million": "latest",
"netlify-plugin-mapkitjs-token": "^1.2.0",
+ "posthog-js": "^1.181.0",
"prettier-eslint": "^16.3.0",
"prettier-eslint-cli": "^8.0.1",
"react": "^18.2.0",
diff --git a/src/App.css b/src/App.css
index 4274be9..736eb91 100644
--- a/src/App.css
+++ b/src/App.css
@@ -104,5 +104,5 @@ body {
font-size: 1.5em;
color: white;
text-align: center;
- background-color: #007fff;
+ background-color: #00af00;
}
diff --git a/src/App.tsx b/src/App.tsx
index 8c2cf2c..274d401 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -69,12 +69,12 @@ function App() {
diff --git a/src/index.tsx b/src/index.tsx
index 1828353..b31f064 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -2,14 +2,22 @@ import React from 'react';
import { createRoot } from 'react-dom/client';
import './index.css';
+import posthog from 'posthog-js';
+import { PostHogProvider } from 'posthog-js/react';
import App from './App';
+posthog.init(process.env.REACT_APP_PUBLIC_POSTHOG_KEY || '', {
+ person_profiles: 'identified_only',
+});
+
const rootElement = document.getElementById('root');
if (rootElement) {
createRoot(rootElement).render(
-
+
+
+
,
);
}
diff --git a/vite.config.ts b/vite.config.ts
index f58a0e5..244a63d 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -58,6 +58,7 @@ export default defineConfig(({ command, mode }) => {
env.MAPKIT_JS_TOKEN_ENV_VARIABLE || 'MAPKIT_JS_TOKEN';
const ttl = +(env.MAPKIT_JS_TTL || 31_536_000); // 1 year
const origin = env.MAPKIT_JS_ORIGIN || env.DEPLOY_PRIME_URL;
+ const posthog = env.REACT_APP_PUBLIC_POSTHOG_KEY;
if (!teamId || !keyId || !authKey || !tokenEnvVariable || !ttl) {
console.error('Missing one or more .env variables! Make sure you have a .env file locally.');
@@ -96,6 +97,7 @@ export default defineConfig(({ command, mode }) => {
return {
define: {
'process.env.VITE_MAPKITJS_TOKEN': JSON.stringify(env[tokenEnvVariable]),
+ 'process.env.REACT_APP_PUBLIC_POSTHOG_KEY': JSON.stringify(posthog),
},
plugins: [
million.vite({ auto: true }),