diff --git a/e2e-tests/fixtures/18c11dda2ee4cd5c20c337d23dd61387.json b/e2e-tests/fixtures/18c11dda2ee4cd5c20c337d23dd61387.json index c1d63c6c..4af5b436 100644 --- a/e2e-tests/fixtures/18c11dda2ee4cd5c20c337d23dd61387.json +++ b/e2e-tests/fixtures/18c11dda2ee4cd5c20c337d23dd61387.json @@ -1,3 +1,3 @@ { - "newContent": "import { StrictMode } from 'react'\nimport { createRoot } from 'react-dom/client'\nimport { PostHogProvider } from 'posthog-js/react'\nimport './index.css'\nimport App from './App.tsx'\n\ncreateRoot(document.getElementById('root')!).render(\n \n \n \n \n ,\n)\n" + "newContent": "import { StrictMode } from 'react'\nimport { createRoot } from 'react-dom/client'\nimport { PostHogProvider } from 'posthog-js/react'\nimport './index.css'\nimport App from './App.tsx'\n\ncreateRoot(document.getElementById('root')!).render(\n \n \n \n \n ,\n)\n" } \ No newline at end of file diff --git a/e2e-tests/fixtures/c9311503b2e7f6b9a027bd2402bb90b7.json b/e2e-tests/fixtures/c9311503b2e7f6b9a027bd2402bb90b7.json index f0f80c27..a074951e 100644 --- a/e2e-tests/fixtures/c9311503b2e7f6b9a027bd2402bb90b7.json +++ b/e2e-tests/fixtures/c9311503b2e7f6b9a027bd2402bb90b7.json @@ -1,3 +1,3 @@ { - "newContent": "import { PostHog } from \"posthog-node\";\n\n// NOTE: This is a Node.js client, so you can use it for sending events from the server side to PostHog.\nexport default function PostHogClient() {\n const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n host: process.env.NEXT_PUBLIC_POSTHOG_HOST,\n flushAt: 1,\n flushInterval: 0,\n });\n return posthogClient;\n}" + "newContent": "import { PostHog } from \"posthog-node\";\n\n// NOTE: This is a Node.js client, so you can use it for sending events from the server side to PostHog.\nexport default function PostHogClient() {\n const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN!, {\n host: process.env.NEXT_PUBLIC_POSTHOG_HOST,\n flushAt: 1,\n flushInterval: 0,\n });\n return posthogClient;\n}" } \ No newline at end of file diff --git a/e2e-tests/fixtures/d4c43e8a5f058dd6547a2c74c6b6051f.json b/e2e-tests/fixtures/d4c43e8a5f058dd6547a2c74c6b6051f.json index 0f356214..fb2742b1 100644 --- a/e2e-tests/fixtures/d4c43e8a5f058dd6547a2c74c6b6051f.json +++ b/e2e-tests/fixtures/d4c43e8a5f058dd6547a2c74c6b6051f.json @@ -1,3 +1,3 @@ { - "newContent": "\"use client\"\n\nimport posthog from \"posthog-js\"\nimport { PostHogProvider as PHProvider } from \"posthog-js/react\"\nimport { useEffect } from \"react\"\n\nexport function PostHogProvider({ children }: { children: React.ReactNode }) {\n useEffect(() => {\n posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {\n api_host: \"/ingest\",\n ui_host: \"http://localhost:8010\",\n defaults: '2025-05-24',\n capture_exceptions: true, // enables Error Tracking\n debug: process.env.NODE_ENV === \"development\",\n })\n }, [])\n\n return {children}\n}\n" + "newContent": "\"use client\"\n\nimport posthog from \"posthog-js\"\nimport { PostHogProvider as PHProvider } from \"posthog-js/react\"\nimport { useEffect } from \"react\"\n\nexport function PostHogProvider({ children }: { children: React.ReactNode }) {\n useEffect(() => {\n posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN!, {\n api_host: \"/ingest\",\n ui_host: \"http://localhost:8010\",\n defaults: '2025-05-24',\n capture_exceptions: true, // enables Error Tracking\n debug: process.env.NODE_ENV === \"development\",\n })\n }, [])\n\n return {children}\n}\n" } \ No newline at end of file diff --git a/src/frameworks/android/android-wizard-agent.ts b/src/frameworks/android/android-wizard-agent.ts index 26131433..f4c752c4 100644 --- a/src/frameworks/android/android-wizard-agent.ts +++ b/src/frameworks/android/android-wizard-agent.ts @@ -80,7 +80,7 @@ export const ANDROID_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/angular/angular-wizard-agent.ts b/src/frameworks/angular/angular-wizard-agent.ts index 06f4105e..bc1b842c 100644 --- a/src/frameworks/angular/angular-wizard-agent.ts +++ b/src/frameworks/angular/angular-wizard-agent.ts @@ -44,7 +44,7 @@ export const ANGULAR_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - NG_APP_POSTHOG_KEY: apiKey, + NG_APP_POSTHOG_PROJECT_TOKEN: apiKey, NG_APP_POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/astro/astro-wizard-agent.ts b/src/frameworks/astro/astro-wizard-agent.ts index f818cdc9..3447fd94 100644 --- a/src/frameworks/astro/astro-wizard-agent.ts +++ b/src/frameworks/astro/astro-wizard-agent.ts @@ -55,7 +55,7 @@ export const ASTRO_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: true, getEnvVars: (apiKey: string, host: string) => ({ - PUBLIC_POSTHOG_KEY: apiKey, + PUBLIC_POSTHOG_PROJECT_TOKEN: apiKey, PUBLIC_POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/django/django-wizard-agent.ts b/src/frameworks/django/django-wizard-agent.ts index cbd58b9a..4b809ecb 100644 --- a/src/frameworks/django/django-wizard-agent.ts +++ b/src/frameworks/django/django-wizard-agent.ts @@ -108,7 +108,7 @@ export const DJANGO_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/fastapi/fastapi-wizard-agent.ts b/src/frameworks/fastapi/fastapi-wizard-agent.ts index 9e423eeb..bf3099f1 100644 --- a/src/frameworks/fastapi/fastapi-wizard-agent.ts +++ b/src/frameworks/fastapi/fastapi-wizard-agent.ts @@ -124,7 +124,7 @@ export const FASTAPI_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/flask/flask-wizard-agent.ts b/src/frameworks/flask/flask-wizard-agent.ts index b9a99178..8b315f1a 100644 --- a/src/frameworks/flask/flask-wizard-agent.ts +++ b/src/frameworks/flask/flask-wizard-agent.ts @@ -116,7 +116,7 @@ export const FLASK_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/javascript-node/javascript-node-wizard-agent.ts b/src/frameworks/javascript-node/javascript-node-wizard-agent.ts index 3c0396dd..74226fc1 100644 --- a/src/frameworks/javascript-node/javascript-node-wizard-agent.ts +++ b/src/frameworks/javascript-node/javascript-node-wizard-agent.ts @@ -30,7 +30,7 @@ export const JAVASCRIPT_NODE_AGENT_CONFIG: FrameworkConfig ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/javascript-web/javascript-web-wizard-agent.ts b/src/frameworks/javascript-web/javascript-web-wizard-agent.ts index 9f5fc17d..2db937c4 100644 --- a/src/frameworks/javascript-web/javascript-web-wizard-agent.ts +++ b/src/frameworks/javascript-web/javascript-web-wizard-agent.ts @@ -82,7 +82,7 @@ export const JAVASCRIPT_WEB_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/laravel/laravel-wizard-agent.ts b/src/frameworks/laravel/laravel-wizard-agent.ts index 919fb7b7..8b1cf7b1 100644 --- a/src/frameworks/laravel/laravel-wizard-agent.ts +++ b/src/frameworks/laravel/laravel-wizard-agent.ts @@ -99,7 +99,7 @@ export const LARAVEL_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/nextjs/nextjs-wizard-agent.ts b/src/frameworks/nextjs/nextjs-wizard-agent.ts index 3dbc0a5a..da5f8b32 100644 --- a/src/frameworks/nextjs/nextjs-wizard-agent.ts +++ b/src/frameworks/nextjs/nextjs-wizard-agent.ts @@ -77,7 +77,7 @@ export const NEXTJS_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: true, getEnvVars: (apiKey: string, host: string) => ({ - NEXT_PUBLIC_POSTHOG_KEY: apiKey, + NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN: apiKey, NEXT_PUBLIC_POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/nuxt/nuxt-wizard-agent.ts b/src/frameworks/nuxt/nuxt-wizard-agent.ts index 50b0327a..78de9aa6 100644 --- a/src/frameworks/nuxt/nuxt-wizard-agent.ts +++ b/src/frameworks/nuxt/nuxt-wizard-agent.ts @@ -51,7 +51,7 @@ export const NUXT_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: true, getEnvVars: (apiKey: string, host: string) => ({ - NUXT_PUBLIC_POSTHOG_KEY: apiKey, + NUXT_PUBLIC_POSTHOG_PROJECT_TOKEN: apiKey, NUXT_PUBLIC_POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/python/python-wizard-agent.ts b/src/frameworks/python/python-wizard-agent.ts index 9741645f..5175575c 100644 --- a/src/frameworks/python/python-wizard-agent.ts +++ b/src/frameworks/python/python-wizard-agent.ts @@ -144,7 +144,7 @@ export const PYTHON_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/rails/rails-wizard-agent.ts b/src/frameworks/rails/rails-wizard-agent.ts index 2119b400..b73e8b6c 100644 --- a/src/frameworks/rails/rails-wizard-agent.ts +++ b/src/frameworks/rails/rails-wizard-agent.ts @@ -48,7 +48,7 @@ export const RAILS_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/react-native/react-native-wizard-agent.ts b/src/frameworks/react-native/react-native-wizard-agent.ts index 3771b45b..861d5d0e 100644 --- a/src/frameworks/react-native/react-native-wizard-agent.ts +++ b/src/frameworks/react-native/react-native-wizard-agent.ts @@ -55,7 +55,7 @@ export const REACT_NATIVE_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/react-router/react-router-wizard-agent.ts b/src/frameworks/react-router/react-router-wizard-agent.ts index 22bcad3d..7367522f 100644 --- a/src/frameworks/react-router/react-router-wizard-agent.ts +++ b/src/frameworks/react-router/react-router-wizard-agent.ts @@ -63,7 +63,7 @@ export const REACT_ROUTER_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - REACT_APP_POSTHOG_KEY: apiKey, + REACT_APP_POSTHOG_PROJECT_TOKEN: apiKey, REACT_APP_POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/ruby/ruby-wizard-agent.ts b/src/frameworks/ruby/ruby-wizard-agent.ts index 2c8c94c3..21c8b8b4 100644 --- a/src/frameworks/ruby/ruby-wizard-agent.ts +++ b/src/frameworks/ruby/ruby-wizard-agent.ts @@ -44,7 +44,7 @@ export const RUBY_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, @@ -86,7 +86,7 @@ export const RUBY_AGENT_CONFIG: FrameworkConfig = { `Use PostHog::Client.new for scripts and standalone applications:`, ``, `client = PostHog::Client.new(`, - ` api_key: ENV['POSTHOG_API_KEY'],`, + ` api_key: ENV['POSTHOG_PROJECT_TOKEN'],`, ` host: ENV['POSTHOG_HOST'] || 'https://us.i.posthog.com'`, `)`, ``, diff --git a/src/frameworks/svelte/svelte-wizard-agent.ts b/src/frameworks/svelte/svelte-wizard-agent.ts index 09f84b11..65f26b59 100644 --- a/src/frameworks/svelte/svelte-wizard-agent.ts +++ b/src/frameworks/svelte/svelte-wizard-agent.ts @@ -40,7 +40,7 @@ export const SVELTEKIT_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: true, getEnvVars: (apiKey: string, host: string) => ({ - PUBLIC_POSTHOG_KEY: apiKey, + PUBLIC_POSTHOG_PROJECT_TOKEN: apiKey, PUBLIC_POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/swift/swift-wizard-agent.ts b/src/frameworks/swift/swift-wizard-agent.ts index 00a3b3e9..19cb845b 100644 --- a/src/frameworks/swift/swift-wizard-agent.ts +++ b/src/frameworks/swift/swift-wizard-agent.ts @@ -75,7 +75,7 @@ export const SWIFT_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - POSTHOG_API_KEY: apiKey, + POSTHOG_PROJECT_TOKEN: apiKey, POSTHOG_HOST: host, }), }, @@ -123,7 +123,7 @@ export const SWIFT_AGENT_CONFIG: FrameworkConfig = { return changes; }, getOutroNextSteps: () => [ - 'Set POSTHOG_API_KEY and POSTHOG_HOST in your Xcode scheme environment variables', + 'Set POSTHOG_PROJECT_TOKEN and POSTHOG_HOST in your Xcode scheme environment variables', 'Build and run your app to see PostHog in action', 'Visit your PostHog dashboard to see incoming events', ], diff --git a/src/frameworks/tanstack-router/tanstack-router-wizard-agent.ts b/src/frameworks/tanstack-router/tanstack-router-wizard-agent.ts index e5489bb4..70a404ef 100644 --- a/src/frameworks/tanstack-router/tanstack-router-wizard-agent.ts +++ b/src/frameworks/tanstack-router/tanstack-router-wizard-agent.ts @@ -74,7 +74,7 @@ export const TANSTACK_ROUTER_AGENT_CONFIG: FrameworkConfig ({ - VITE_PUBLIC_POSTHOG_KEY: apiKey, + VITE_PUBLIC_POSTHOG_PROJECT_TOKEN: apiKey, VITE_PUBLIC_POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/tanstack-start/tanstack-start-wizard-agent.ts b/src/frameworks/tanstack-start/tanstack-start-wizard-agent.ts index 0b2e4d64..2a62f939 100644 --- a/src/frameworks/tanstack-start/tanstack-start-wizard-agent.ts +++ b/src/frameworks/tanstack-start/tanstack-start-wizard-agent.ts @@ -51,7 +51,7 @@ export const TANSTACK_START_AGENT_CONFIG: FrameworkConfig environment: { uploadToHosting: false, getEnvVars: (apiKey: string, host: string) => ({ - VITE_PUBLIC_POSTHOG_KEY: apiKey, + VITE_PUBLIC_POSTHOG_PROJECT_TOKEN: apiKey, VITE_PUBLIC_POSTHOG_HOST: host, }), }, diff --git a/src/frameworks/vue/vue-wizard-agent.ts b/src/frameworks/vue/vue-wizard-agent.ts index 6c61df15..38042334 100644 --- a/src/frameworks/vue/vue-wizard-agent.ts +++ b/src/frameworks/vue/vue-wizard-agent.ts @@ -41,7 +41,7 @@ export const VUE_AGENT_CONFIG: FrameworkConfig = { environment: { uploadToHosting: true, getEnvVars: (apiKey: string, host: string) => ({ - VITE_POSTHOG_KEY: apiKey, + VITE_POSTHOG_PROJECT_TOKEN: apiKey, VITE_POSTHOG_HOST: host, }), }, diff --git a/src/lib/__tests__/yara-scanner.test.ts b/src/lib/__tests__/yara-scanner.test.ts index 72b1656e..987e7255 100644 --- a/src/lib/__tests__/yara-scanner.test.ts +++ b/src/lib/__tests__/yara-scanner.test.ts @@ -188,14 +188,14 @@ posthog.capture('signup', { email: user.email })`; expect(result.matched).toBe(true); }); - it('detects POSTHOG_KEY assignment', () => { - const content = `POSTHOG_KEY = 'abcdefghijklmnopqrstuvwxyz1234'`; + it('detects POSTHOG_PROJECT_TOKEN assignment', () => { + const content = `POSTHOG_PROJECT_TOKEN = 'abcdefghijklmnopqrstuvwxyz1234'`; const result = scan(content, 'PostToolUse', 'Write'); expect(result.matched).toBe(true); }); it('does not trigger on env var reference', () => { - const content = `posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY)`; + const content = `posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN)`; const result = scan(content, 'PostToolUse', 'Write'); expect(result.matched).toBe(false); }); diff --git a/src/lib/commandments.ts b/src/lib/commandments.ts index c07e87b5..23d6fbd9 100644 --- a/src/lib/commandments.ts +++ b/src/lib/commandments.ts @@ -5,7 +5,7 @@ * without extra files, copying, or runtime I/O. */ const WIZARD_COMMANDMENTS = [ - 'Never hallucinate a PostHog API key, host, or any other secret. Always use the real values that have been configured for this project (for example via environment variables).', + 'Never hallucinate a PostHog project token, host, or any other secret. Always use the real values that have been configured for this project (for example via environment variables).', 'Never write API keys, access tokens, or other secrets directly into source code. Always reference environment variables instead, and rely on the wizard-tools MCP server (check_env_keys / set_env_values) to create or update .env files.', diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 86528fbe..c7c901a4 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -74,7 +74,7 @@ export const POSTHOG_US_CLIENT_ID = 'c4Rdw8DIxgtQfA80IiSnGKlNX8QN00cFWF00QQhM'; export const POSTHOG_EU_CLIENT_ID = 'bx2C5sZRN03TkdjraCcetvQFPGH6N2Y9vRLkcKEy'; export const POSTHOG_DEV_CLIENT_ID = 'DC5uRLVbGI02YQ82grxgnK6Qn12SXWpCqdPb60oZ'; export const POSTHOG_PROXY_CLIENT_ID = POSTHOG_US_CLIENT_ID; -export const DUMMY_PROJECT_API_KEY = '_YOUR_POSTHOG_PROJECT_API_KEY_'; +export const DUMMY_PROJECT_API_KEY = '_YOUR_POSTHOG_PROJECT_TOKEN_'; // ── Wizard run / variants ─────────────────────────────────────────── diff --git a/src/lib/wizard-tools.ts b/src/lib/wizard-tools.ts index 52f018de..206c0183 100644 --- a/src/lib/wizard-tools.ts +++ b/src/lib/wizard-tools.ts @@ -295,16 +295,16 @@ export async function createWizardToolsServer(options: WizardToolsOptions) { .describe('Key-value pairs to set'), }, (args: { filePath: string; values: Record }) => { - // Block the wrong key name — the correct key is NEXT_PUBLIC_POSTHOG_KEY or similar + // Block the wrong key name — the correct key is NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN or similar const forbidden = Object.keys(args.values).find( - (k) => k.toUpperCase() === 'POSTHOG_API_KEY', + (k) => k.toUpperCase() === 'POSTHOG_KEY', ); if (forbidden) { return { content: [ { type: 'text' as const, - text: `Error: "${forbidden}" is not a valid PostHog env var name. Use the project-specific key name from your framework's integration guide (e.g. NEXT_PUBLIC_POSTHOG_KEY).`, + text: `Error: "${forbidden}" is not a valid PostHog env var name. Use the project-specific key name from your framework's integration guide (e.g. NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN).`, }, ], isError: true, diff --git a/src/lib/yara-scanner.ts b/src/lib/yara-scanner.ts index 53b33a45..8ed0d899 100644 --- a/src/lib/yara-scanner.ts +++ b/src/lib/yara-scanner.ts @@ -122,7 +122,7 @@ const hardcoded_posthog_key: YaraRule = { // Hardcoded key assignment patterns /apiKey\s*[:=]\s*['"][a-zA-Z0-9_]{20,}['"]/, /api_key\s*[:=]\s*['"][a-zA-Z0-9_]{20,}['"]/, - /POSTHOG_KEY\s*[:=]\s*['"][a-zA-Z0-9_]{20,}['"]/, + /POSTHOG_PROJECT_TOKEN\s*[:=]\s*['"][a-zA-Z0-9_]{20,}['"]/, ], }; diff --git a/src/utils/rules/astro-rules.md b/src/utils/rules/astro-rules.md index 1e50addb..56783ce9 100644 --- a/src/utils/rules/astro-rules.md +++ b/src/utils/rules/astro-rules.md @@ -6,7 +6,7 @@ PostHog is already integrated into this Astro project. The configuration include - PostHog initialization in `src/components/posthog.astro` - Layout setup in `src/layouts/PostHogLayout.astro` -- Environment variables for API key and host +- Environment variables for project token and host ## Key Guidelines @@ -17,7 +17,7 @@ PostHog is already integrated into this Astro project. The configuration include ### Environment Variables - Use `PUBLIC_` prefix for client-side environment variables in Astro -- `PUBLIC_POSTHOG_KEY` - Your PostHog project API key +- `PUBLIC_POSTHOG_PROJECT_TOKEN` - Your PostHog project token - `PUBLIC_POSTHOG_HOST` - Your PostHog instance URL ### Best Practices