-
Notifications
You must be signed in to change notification settings - Fork 0
[CI] (a283762) next-js/15-app-router-saas #199
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
|
The files are not available in the local file system as this is a PR evaluation. I'll proceed to evaluate the PR based on the diff provided. PR Evaluation ReportSummaryThis PR integrates PostHog analytics into a Next.js 15 App Router SaaS application. It adds both client-side (
Confidence score: 4/5 👍
File changes
App sanity check: 4/5 ✅
Issues
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.324.1 and posthog-node@^5.21.0 added to package.json |
| PostHog client initialized | Yes | Client init via instrumentation-client.ts using Next.js 15 pattern; server client via lib/posthog-server.ts |
| capture() | Yes | Multiple capture calls across auth, subscription, team, and account events |
| identify() | Yes | User identification on sign-in/sign-up with email |
| Error tracking | Yes | capture_exceptions: true enabled in client config |
| Reverse proxy | Yes | Properly configured in next.config.ts with /ingest rewrites to PostHog US endpoints |
Issues
- Inconsistent distinct ID strategy: Client-side uses email for identify(), server-side checkout uses email, but webhook handler uses Stripe customer ID. This creates fragmented user profiles in PostHog. All events should use a consistent identifier (preferably a stable internal user ID). [MEDIUM]
- onClick timing captures premature events: Events like
account_updated,password_updated,team_member_invitedfire on button click before the server action completes. If the action fails, the event is still captured, leading to inaccurate analytics. Consider tracking on successful action completion instead. [MEDIUM] - Missing pageview tracking: No explicit pageview tracking setup. While
capture_pageviewdefaults may handle this, it's not explicitly configured. [LOW]
Other completed criteria
posthog.reset()called on sign-out and account deletion- Debug mode enabled only in development
- Proper api_host configuration for reverse proxy
defaults: '2025-05-24'sets modern SDK defaults- Server-side events include relevant business properties
PostHog insights and events: 4/5 ✅
| Filename | PostHog events | Description |
|---|---|---|
login.tsx |
user_signed_in, user_signed_up, identify() |
Core authentication funnel tracking with user identification |
layout.tsx |
user_signed_out |
Session end tracking with identity reset |
submit-button.tsx |
checkout_started |
Checkout funnel entry point |
checkout/route.ts |
checkout_completed |
Server-side checkout success with plan details |
webhook/route.ts |
subscription_updated, subscription_cancelled |
Subscription lifecycle events |
dashboard/page.tsx |
manage_subscription_clicked, team_member_removed, team_member_invited |
Team and subscription management actions |
general/page.tsx |
account_updated |
Profile update tracking |
security/page.tsx |
password_updated, account_deleted |
Security and account lifecycle events |
instrumentation-client.ts |
capturedException |
Automatic exception capture enabled |
Issues
- Webhook events lack user context: Subscription events use Stripe customer ID but don't link to the internal user identity used elsewhere. This breaks funnel analysis connecting
checkout_started→checkout_completed→subscription_updated. [MEDIUM] - Team member events capture PII:
team_member_invitedcapturesinvited_emailwhich may be considered PII depending on compliance requirements. [LOW]
Other completed criteria
- Events cover full user lifecycle (signup → subscription → team management → account deletion)
- Events enriched with relevant properties (plan_name, subscription_status, member_role)
- Supports building conversion funnels (signup → checkout → subscription)
- Enables cohort analysis by subscription status
- Team size and engagement metrics trackable
Reviewed by wizard workbench PR evaluator
Automated wizard CI run
Source: manual
Trigger ID:
a283762App:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-a283762-next-js-15-app-router-saasWizard branch:
mainExamples branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-01-15T22:38:44.864Z
Duration: 405.5s