Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

refactor(posthog): normalize endpoint env var name (#890)

Corentin Thomasset1624efc9d947
diff --git a/apps/docs/astro.config.ts b/apps/docs/astro.config.ts
index 2b5ab46c..1222b326 100644
--- a/apps/docs/astro.config.ts
+++ b/apps/docs/astro.config.ts
@@ -9,7 +9,7 @@ import { sidebar } from './src/content/navigation';
import posthogRawScript from './src/scripts/posthog.script.js?raw';
const posthogApiKey = env.POSTHOG_API_KEY;
-const posthogApiHost = env.POSTHOG_API_HOST ?? 'https://eu.i.posthog.com';
+const posthogApiHost = env.POSTHOG_HOST ?? 'https://eu.i.posthog.com';
const isPosthogEnabled = Boolean(posthogApiKey);
const posthogScript = posthogRawScript.replace('[POSTHOG-API-KEY]', posthogApiKey ?? '').replace('[POSTHOG-API-HOST]', posthogApiHost);
diff --git a/apps/website/src/components/PosthogAnalytics.astro b/apps/website/src/components/PosthogAnalytics.astro
index fcd8b073..614f5fbd 100644
--- a/apps/website/src/components/PosthogAnalytics.astro
+++ b/apps/website/src/components/PosthogAnalytics.astro
@@ -1,6 +1,6 @@
---
const apiKey: string | undefined = import.meta.env.POSTHOG_API_KEY;
-const apiHost: string = import.meta.env.POSTHOG_API_HOST ?? 'https://eu.i.posthog.com';
+const apiHost: string = import.meta.env.POSTHOG_HOST ?? 'https://eu.i.posthog.com';
const isEnabled: boolean = Boolean(apiKey);
---
{ isEnabled && (