[CI] (3a9542d) next-js/15-app-router-saas#266
Closed
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
Closed
[CI] (3a9542d) next-js/15-app-router-saas#266wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
Conversation
Author
|
The files don't exist locally, but I have the complete diff provided in the PR. Let me analyze based on the diff content, which contains all the necessary information to perform the evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog analytics into a Next.js 15 App Router SaaS application. It adds both client-side and server-side tracking, implements a reverse proxy configuration, and instruments 11 key user actions across authentication, checkout, subscription management, and account settings flows.
Confidence score: 4/5 👍
File changes
App sanity check: 4/5 ✅
Issues
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.335.3 and posthog-node@^5.24.2 in package.json |
| PostHog client initialized | Yes | Client-side via instrumentation-client.ts using Next.js 15.3+ pattern; server-side via lib/posthog-server.ts |
| capture() | Yes | Multiple capture calls for user actions across client and server |
| identify() | Partial | Only called in login.tsx, and the logic is flawed for successful logins |
| Error tracking | Yes | capture_exceptions: true for client-side; captureException() used server-side |
| Reverse proxy | Yes | Configured in next.config.ts with /ingest path rewrites |
Issues
- Singleton shutdown pattern issue: The server-side client uses a singleton pattern but calls
posthog.shutdown()after each request. This will close the client and may cause race conditions or errors on subsequent requests. Should either remove the singleton pattern or not call shutdown on each request. [MEDIUM] - Sign-in/sign-up events never fire: In login.tsx, successful authentication redirects to another page, meaning the client-side code after
signIn/signUpnever executes. These events should be tracked server-side in the action handlers instead. [MEDIUM] - Missing pageview tracking configuration: While
capture_exceptionsis enabled, no explicit pageview tracking is configured. PostHog'scapture_pageviewshould be explicitly set or the default behavior clarified. [LOW]
Other completed criteria
- API key loaded from environment variable (NEXT_PUBLIC_POSTHOG_KEY)
- Correct API host configuration with reverse proxy
- Session reset on logout (
posthog.reset()) - ui_host configured correctly for US region
- Debug mode enabled only in development
PostHog insights and events: 4/5 ✅
| Filename | PostHog events | Description |
|---|---|---|
login.tsx |
user_signed_in, user_signed_up |
Authentication events with email and invite context (but may not fire correctly) |
layout.tsx |
user_signed_out |
Logout tracking with session reset |
submit-button.tsx |
checkout_started |
Checkout funnel entry point |
checkout/route.ts |
checkout_completed, captureException |
Successful checkout with plan details, error tracking |
webhook/route.ts |
subscription_updated, subscription_canceled, captureException |
Subscription lifecycle events |
general/page.tsx |
account_updated |
Profile update tracking with name/email properties |
security/page.tsx |
password_updated, account_deleted |
Security-related user actions |
actions.ts |
team_member_invited, team_member_removed |
Team collaboration events with role/member context |
Issues
- PII in event properties: Email addresses are captured as properties in
account_updatedandteam_member_invitedevents. Consider whether this is appropriate for your data policies. [LOW] - Missing user identification for server-side events: Server-side events use email as distinctId but don't include additional user properties. Consider adding more context for user-level analysis. [LOW]
Other completed criteria
- Events represent real user actions and product flows
- Events can power funnel analysis (signup → checkout → subscription)
- Events include relevant properties for segmentation
- Churn signals captured (subscription_canceled, account_deleted)
- Error tracking enables debugging production issues
- Team collaboration events enable B2B analytics
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:
3a9542dApp:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-3a9542d-next-js-15-app-router-saasWizard branch:
mainContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-01-26T22:45:16.205Z
Duration: 470.9s