Skip to content

Add PostHog analytics with session replay to web app#31

Merged
RogutKuba merged 2 commits into
mainfrom
RogutKuba/posthog-session-replay
Jul 25, 2026
Merged

Add PostHog analytics with session replay to web app#31
RogutKuba merged 2 commits into
mainfrom
RogutKuba/posthog-session-replay

Conversation

@RogutKuba

Copy link
Copy Markdown
Member

Wires PostHog (posthog-js) into the web app alongside the existing Sentry setup: a new src/lib/posthog.ts initializes analytics and session replay with all inputs masked by default, and main.tsx identifies the signed-in user and their active organization (resetting on sign-out). The project key is env-var only via VITE_PUBLIC_POSTHOG_KEY with no baked default (host defaults to https://us.i.posthog.com), so PostHog stays disabled in local dev and until a key is configured. Env vars are documented in .env.example and threaded through vite.config.ts.

To enable, set VITE_PUBLIC_POSTHOG_KEY at build time and turn on session recording in the PostHog project settings.

🤖 Generated with Claude Code

Initialize posthog-js alongside Sentry, identify users and their active
org, and enable session replay with inputs masked by default. The project
key is env-var only (VITE_PUBLIC_POSTHOG_KEY) with no baked default, so
PostHog stays disabled in local dev and until a key is configured.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 25, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
coderscreen-marketing Ready Ready Preview, Comment Jul 25, 2026 10:02pm

Request Review

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 25, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
coderscreen-api 9813343 Jul 25 2026, 10:02 PM

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 25, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
coderscreen-web 9813343 Jul 25 2026, 10:02 PM

@RogutKuba
RogutKuba merged commit 0d3166a into main Jul 25, 2026
5 checks passed
@RogutKuba
RogutKuba deleted the RogutKuba/posthog-session-replay branch July 25, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant