Skip to content

Commit 4ae4292

Browse files
committed
feat: update PostHog client configuration and add Netlify redirects
1 parent f022b7c commit 4ae4292

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

app/plugins/posthog.client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import posthog from 'posthog-js'
33
export default defineNuxtPlugin(() => {
44
const runtimeConfig = useRuntimeConfig()
55
const posthogClient = posthog.init(runtimeConfig.public.posthogPublicKey, {
6-
api_host: runtimeConfig.public.posthogHost,
6+
api_host: '/ph',
7+
ui_host: runtimeConfig.public.posthogHost,
78
person_profiles: 'identified_only',
89
capture_pageview: false, // We'll handle this manually with the router,
910
cookieless_mode: 'always', // Use cookieless mode to avoid cookie consent issues

netlify.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[[redirects]]
2+
from = "/ph/static/*"
3+
to = "https://eu-assets.i.posthog.com/static/:splat"
4+
host = "eu-assets.i.posthog.com"
5+
status = 200
6+
force = true
7+
8+
[[redirects]]
9+
from = "/ph/*"
10+
to = "https://eu.i.posthog.com/:splat"
11+
host = "eu.i.posthog.com"
12+
status = 200
13+
force = true

0 commit comments

Comments
 (0)