-
Notifications
You must be signed in to change notification settings - Fork 0
[CI] (afd8cc2) next-js/15-app-router-saas #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Now I have all the information needed to provide a comprehensive evaluation. Let me compile the PR review. PR Evaluation ReportSummaryThis PR integrates PostHog analytics into a Next.js 15 SaaS application with both client-side and server-side tracking. The implementation includes user authentication events, subscription lifecycle tracking, team management events, and a reverse proxy for ad-blocker circumvention. The integration follows modern Next.js patterns using
Confidence score: 4/5 👍
File changes
App sanity check: 4/5 ✅
Issues
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.325.0 and posthog-node@^5.21.0 added to dependencies |
| PostHog client initialized | Yes | Client initialized in instrumentation-client.ts with reverse proxy api_host (/ingest), exception capture enabled |
| capture() | Yes | 12 distinct events captured across client and server components |
| identify() | Yes | User identified with email on sign-in/sign-up in login.tsx |
| Error tracking | Yes | capture_exceptions: true enabled in client config, captureException() used in checkout error handling |
| Reverse proxy | Yes | Properly configured in next.config.ts with rewrites to us.i.posthog.com and us-assets.i.posthog.com |
Issues
- Server-side distinctId inconsistency: Checkout uses
user[0].emailas distinctId, but webhook usessubscription.customer(Stripe customer ID). This breaks user correlation in PostHog. Should consistently use email or a stable user identifier. [MEDIUM] - No server-side flush/shutdown: Events captured server-side may be lost in serverless environments without explicit
posthog.shutdown()call after capturing. Consider usingawait posthog.shutdown()at end of API routes. [MEDIUM] - PII in event properties: Email is passed in event properties for sign-in/sign-up events. This is redundant since user is already identified. [LOW]
Other completed criteria
posthog.reset()called on sign-out and account deletion- Debug mode enabled only in development
- Modern
instrumentation-client.tspattern used (Next.js 15.3+) skipTrailingSlashRedirect: trueconfigured for PostHog compatibilitydefaults: '2025-05-24'configuration string used for latest defaults
PostHog insights and events: 4/5 ✅
| Filename | PostHog events | Description |
|---|---|---|
login.tsx |
user_signed_in, user_signed_up |
Authentication funnel tracking with user identification |
layout.tsx |
user_signed_out |
Session end tracking with proper reset |
submit-button.tsx |
checkout_started |
Conversion funnel entry point |
checkout/route.ts |
checkout_completed, capturedException |
Server-side conversion completion with rich subscription properties |
webhook/route.ts |
subscription_updated, subscription_cancelled |
Server-side subscription lifecycle tracking |
general/page.tsx |
account_updated |
Account settings engagement |
security/page.tsx |
password_updated, account_deleted |
Security-related user actions |
dashboard/page.tsx |
team_member_invited, team_member_removed, manage_subscription_clicked |
Team management and subscription portal engagement |
Issues
- Missing pageview tracking: No explicit pageview events configured. While PostHog auto-captures pageviews by default, this should be verified works with the reverse proxy setup. [LOW]
- Limited event properties: Some events like
account_updated,password_updated,team_member_removed,team_member_invitedcapture no properties. Adding context (e.g., role for team events) would improve insights. [LOW]
Other completed criteria
- Full user journey tracked: signup → checkout → subscription management → account actions
- Subscription events include rich properties (plan_name, subscription_id, customer_id, status)
- Manage subscription click includes current plan and status context
- Events are snake_case and follow consistent naming convention
- Documentation includes suggested PostHog dashboard insights
Reviewed by wizard workbench PR evaluator
Automated wizard CI run
Source: manual
Trigger ID:
afd8cc2App:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-afd8cc2-next-js-15-app-router-saasWizard branch:
mainExamples branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-01-16T14:00:44.601Z
Duration: 383.1s