[CI] (362fa9c) next-js/15-pages-router-saas#316
Closed
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
Closed
[CI] (362fa9c) next-js/15-pages-router-saas#316wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
Conversation
Author
|
The TypeScript check passes. Now I have enough information to write the evaluation report. PR Evaluation ReportSummaryThis PR adds a comprehensive PostHog analytics integration to a Next.js 15 Pages Router SaaS application. It implements client-side initialization via
Confidence score: 4/5 👍
File changes
App sanity check: 4/5 ✅
Issues
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js (^1.345.5) and posthog-node (^5.24.15) in package.json |
| PostHog client initialized | Yes | Client-side via instrumentation-client.ts, server-side via singleton in lib/posthog-server.ts |
| capture() | Yes | 11 custom events captured across auth, checkout, subscription, and team flows |
| identify() | Yes | Server-side identify on sign-in/sign-up, client-side identify on login |
| Error tracking | Yes | captureException() calls in all catch blocks, capture_exceptions: true enabled |
| Reverse proxy | Yes | Properly configured in next.config.ts with /ingest route and trailing slash handling |
Issues
- Identity mismatch between client and server: Client-side
posthog.identify()inlogin.tsxusesdata.emailas distinctId, while server-side usesuser.id.toString(). This can cause user identity fragmentation. Use consistent user ID across both. [MEDIUM] - Server-side host configuration: The server client uses
NEXT_PUBLIC_POSTHOG_HOSTwhich may point to the public PostHog URL, not the reverse proxy. For server-side, this is acceptable but should be documented. [LOW] - Stripe webhook distinctId: Uses Stripe customer ID as distinctId for subscription events, which may not link to the user's PostHog profile unless aliased. [LOW]
Other completed criteria
- API key properly loaded from environment variable (not hardcoded)
- Correct API host configuration (
/ingestfor client) - UI host set correctly (
https://us.posthog.com) - Debug mode enabled in development
- Defaults preset configured (
2025-11-30) posthog.reset()called on logout- Shutdown method provided for server client
PostHog insights and events: 4/5 ✅
| Filename | PostHog events | Description |
|---|---|---|
pages/api/auth/sign-in.ts |
user_signed_in |
User authentication with email, team info, and checkout redirect flag |
pages/api/auth/sign-up.ts |
user_signed_up |
User registration with role, team, invitation status, and checkout flow |
pages/api/auth/sign-out.ts |
user_signed_out |
Logout tracking with user email |
components/header.tsx |
user_logged_out, captureException |
Client-side logout and error tracking |
components/login.tsx |
captureException |
Authentication error capture |
pages/api/stripe/create-checkout.ts |
checkout_started |
Checkout initiation with price and team details |
pages/api/stripe/checkout.ts |
checkout_completed |
Successful checkout with plan and subscription info |
pages/api/stripe/webhook.ts |
subscription_updated, subscription_cancelled |
Subscription lifecycle events |
pages/api/account/update.ts |
account_updated |
Account changes with old/new values |
pages/api/team/invite.ts |
team_member_invited |
Team invitation with role and inviter info |
pages/api/team/remove-member.ts |
team_member_removed |
Team member removal tracking |
pages/pricing.tsx |
pricing_plan_clicked |
Plan selection with pricing details |
Issues
- No page view tracking: The integration captures custom events but lacks automatic page view tracking. Add
capture_pageview: trueto client config or implement manual page view tracking for complete user journey analytics. [MEDIUM] - Missing failed login/signup events: Only successful auth events are tracked. Consider adding
user_sign_in_failedanduser_sign_up_failedevents when validation fails to track conversion friction. [LOW]
Other completed criteria
- Events capture real user actions (sign-up, sign-in, checkout, team management)
- Events support funnel analysis (signup → checkout_started → checkout_completed)
- Events enriched with relevant properties (team_id, email, plan details)
- Subscription lifecycle tracked for churn analysis
- Error tracking enables debugging and user experience monitoring
- No PII exposed inappropriately - email used appropriately for identification
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:
362fa9cApp:
next-js/15-pages-router-saasApp directory:
apps/next-js/15-pages-router-saasWorkbench branch:
wizard-ci-362fa9c-next-js-15-pages-router-saasWizard branch:
mainContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-02-11T17:38:33.498Z
Duration: 579.0s