-
Notifications
You must be signed in to change notification settings - Fork 0
[CI] (bd5a2b4) next-js/15-app-router-saas #240
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 complete the evaluation. Let me compile the PR evaluation report. PR Evaluation ReportSummaryThis PR integrates PostHog analytics into a Next.js 15 App Router SaaS application. The integration includes client-side initialization via
Confidence score: 3/5 🤔
File changes
App sanity check: 4/5 ✅
Issues
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.333.0 and posthog-node@^5.24.1 in package.json |
| PostHog client initialized | Yes | Client via instrumentation-client.ts, server via singleton in lib/posthog-server.ts |
| capture() | Yes | 12 distinct events captured across client and server |
| identify() | Yes | User identification on sign-in, sign-up, and account update; but uses email as distinctId in client |
| Error tracking | Yes | capture_exceptions: true enabled in client initialization |
| Reverse proxy | Yes | Properly configured via Next.js rewrites in next.config.ts |
Issues
- Missing flush/await on server-side events: All server actions use fire-and-forget
posthog.capture()withoutawait posthog.flush(). In serverless/edge environments like Vercel, the function may terminate before events are sent. Should addawait posthog.flush()after captures or useflushSyncpatterns. [CRITICAL] - Email used as distinctId in client:
posthog.identify(email, {...})inlogin.tsxsets email as the user's primary identifier. Should use a stable user ID and set email as a property instead. [MEDIUM] - Email captured in event properties: Events like
sign_in,sign_up,sign_out,account_deleted, andteam_member_invitedinclude email in properties. This is PII and may violate privacy policies. Consider removing or hashing. [MEDIUM] - Server client uses NEXT_PUBLIC env vars: Server-side PostHog should ideally use a separate
POSTHOG_API_KEY(non-public) variable, though using NEXT_PUBLIC still works. [LOW]
Other completed criteria
- Correct API host configuration via reverse proxy (
/ingest) ui_hostproperly set for PostHog UI elements- Exception capture enabled
- Debug mode only in development
skipTrailingSlashRedirectenabled for PostHog compatibility- Singleton pattern prevents multiple client instances
shutdownPostHog()helper provided for graceful shutdown
PostHog insights and events: 4/5 ✅
| Filename | PostHog events | Description |
|---|---|---|
actions.ts |
sign_up, sign_in, sign_out, password_updated, account_deleted, account_updated, team_member_removed, team_member_invited |
Comprehensive auth and team management funnel tracking with user/team context |
submit-button.tsx |
pricing_plan_selected |
Tracks interest in pricing; missing price tier information |
lib/payments/actions.ts |
checkout_started |
Captures conversion funnel entry with price_id |
checkout/route.ts |
checkout_completed |
Server-side conversion completion with full Stripe metadata |
webhook/route.ts |
subscription_updated |
Subscription lifecycle tracking including status and event type |
instrumentation-client.ts |
capturedException (automatic) |
Automatic exception capture for error monitoring |
Issues
- Missing pageview configuration: While Next.js 15 instrumentation handles client initialization, there's no explicit
capture_pageviewsconfiguration. Default behavior may vary. [LOW] - pricing_plan_selected missing context: The event doesn't capture which plan/price was selected, reducing analytical value. [MEDIUM]
Other completed criteria
- Events represent real user actions and product flows
- Full conversion funnel trackable:
sign_up→checkout_started→checkout_completed - Churn tracking via
account_deletedevent - Team collaboration events (
team_member_invited,team_member_removed) - Subscription status changes captured for MRR analysis
- Events enriched with user_id, team_id, and contextual properties
Reviewed by wizard workbench PR evaluator
Automated wizard CI run
Source: manual
Trigger ID:
bd5a2b4App:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-bd5a2b4-next-js-15-app-router-saasWizard branch:
mainExamples branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-01-21T21:09:32.434Z
Duration: 479.1s