Skip to content

Commit 14dd40c

Browse files
committed
fix(analytics): add posthog ingest proxy rewrites and document env vars
1 parent ace8779 commit 14dd40c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

apps/sim/.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ API_ENCRYPTION_KEY=your_api_encryption_key # Use `openssl rand -hex 32` to gener
4141
# Admin API (Optional - for self-hosted GitOps)
4242
# ADMIN_API_KEY= # Use `openssl rand -hex 32` to generate. Enables admin API for workflow export/import.
4343
# Usage: curl -H "x-admin-key: your_key" https://your-instance/api/v1/admin/workspaces
44+
45+
# Product Analytics - PostHog (Optional)
46+
# NEXT_PUBLIC_POSTHOG_KEY=phc_... # Your PostHog project API key (from posthog.com or self-hosted)
47+
# NEXT_PUBLIC_POSTHOG_ENABLED=true # Set to true to enable analytics. Omit or set to false to disable entirely.
48+
# When disabled: server SDK never initializes, client SDK never loads.

apps/sim/next.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,14 @@ const nextConfig: NextConfig = {
417417
source: '/r/:shortCode',
418418
destination: 'https://go.trybeluga.ai/:shortCode',
419419
},
420+
{
421+
source: '/ingest/static/:path*',
422+
destination: 'https://us-assets.i.posthog.com/static/:path*',
423+
},
424+
{
425+
source: '/ingest/:path*',
426+
destination: 'https://us.i.posthog.com/:path*',
427+
},
420428
]
421429
},
422430
}

0 commit comments

Comments
 (0)