[CI] (confirm-54-low-notes) next-js/15-app-router-saas#2410
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
[CI] (confirm-54-low-notes) next-js/15-app-router-saas#2410wizard-ci-bot[bot] wants to merge 1 commit into
wizard-ci-bot[bot] wants to merge 1 commit into
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 App Router SaaS application. It adds both client-side (
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors; all imports resolve to valid packages |
| Preserves existing env vars & configs | Yes | Existing configs preserved; only PostHog additions made. Removed comments in next.config.ts are non-functional. |
| No syntax or type errors | Yes | All TypeScript/JSX is valid |
| Correct imports/exports | Yes | posthog-js correctly imported in client components; posthog-node in server-only file |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | None | No pre-existing issues detected |
Issues
- Unused
useimport removal — Theuseimport from React was removed from the dashboard layout. This is correct asusewas not referenced in the file. [LOW]
Other completed criteria
- Environment variables use
NEXT_PUBLIC_prefix for client-side access server-onlyimport guard on server-side PostHog module- Build configuration valid with proper
rewritesandskipTrailingSlashRedirect
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.396.6 and posthog-node@^5.39.4 added to package.json |
| PostHog client initialized | Yes | Initialized in instrumentation-client.ts with env vars, reverse proxy, and error tracking — correct pattern for Next.js 15.3+ |
| capture() | Yes | Multiple meaningful posthog.capture() calls across auth, profile, security, and navigation flows |
| identify() | No | Never called. The app has login/signup forms but no posthog.identify() is invoked on auth success. identifyServerUser() helper exists but is never used. |
| Error tracking | Yes | capture_exceptions: true set in init config enabling automatic exception autocapture |
| Reverse proxy | Yes | Properly configured via Next.js rewrites: /ingest/static/* and /ingest/array/* → us-assets.i.posthog.com, /ingest/* → PostHog host |
Issues
- No
posthog.identify()call anywhere: The app has full authentication (login, signup, user sessions) but never callsposthog.identify(). All captured events remain anonymous, making it impossible to build user-level funnels, retention analysis, or connect sessions across devices. TheidentifyServerUser()helper is defined inlib/posthog-server.tsbut never invoked. The login form should callposthog.identify(userId, { email, name })after successful authentication. [CRITICAL] - **Double
events**: The `PostHogPageview` component manually fires `posthog.capture('')`, but `capture_pageview` is not set to `false` in `posthog.init()`. By default, `posthog-js` auto-captures aon initialization, causing two pageview events on the first page load. Addcapture_pageview: falseto the init config. [CRITICAL] - Server-side helpers are unused dead code:
captureServerEvent()andidentifyServerUser()are defined inlib/posthog-server.tsbut no committed file calls them. They add complexity without value. [MEDIUM]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable - API host correctly configured via reverse proxy (
/ingest) withui_hostfallback posthog.reset()correctly called on sign-outskipTrailingSlashRedirect: trueset for reverse proxy compatibility- Both
/static/*and/array/*asset routes configured for reverse proxy
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
components/posthog-pageview.tsx |
`` | Manual pageview tracking on route changes with pathname and query params |
app/(login)/login.tsx |
auth_form_submitted |
Tracks signin/signup form submissions with auth_mode, invite status, redirect target, and email domain |
app/(dashboard)/layout.tsx |
navigation_sign_out_clicked |
Captures sign-out action from user menu; also calls posthog.reset() |
app/(dashboard)/dashboard/general/page.tsx |
account_profile_updated |
Tracks profile form submission with has_name flag and email_domain |
app/(dashboard)/dashboard/security/page.tsx |
password_update_submitted, account_deletion_submitted |
Captures security-critical actions with source context |
instrumentation-client.ts |
captureException (auto) |
Automatic exception capture via capture_exceptions: true |
Issues
- No identify means events lack user association: Without
posthog.identify(), all the well-crafted events above are anonymous and cannot be used for per-user funnels (e.g., signup → profile update → retention). [CRITICAL]
Other completed criteria
- Events represent real user actions (auth, profile updates, security changes, sign-out)
- Events enable product insights — could build signup funnel, security action trends, churn analysis (account deletion)
- Events include relevant enrichment properties (auth_mode, source, has_invite, redirect_target, email_domain)
- No PII in event properties — emails extracted to domain-only; names reduced to boolean
has_name - Event names are descriptive and use consistent
snake_caseconvention
Reviewed by wizard workbench PR evaluator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated wizard CI run
Source: manual
Trigger ID:
confirm-54-low-notesApp:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-confirm-54-low-notes-next-js-15-app-router-saasWizard branch:
b98223d7c679b8f62ebb64f48ef09a1e8ba60724Context Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-03T18:05:34.943Z
Duration: 401.7s
YARA Scanner