-
Notifications
You must be signed in to change notification settings - Fork 0
[CI] (3864784) next-js/15-pages-router-saas #255
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 I need. Let me write the comprehensive PR evaluation report. PR Evaluation ReportSummaryThis PR integrates PostHog analytics into a Next.js 15 Pages 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.333.0 and posthog-node@^5.24.1 in package.json |
| PostHog client initialized | Partial | Client initialized in instrumentation-client.ts, server singleton in lib/posthog-server.ts. Client init may not load for Pages Router. |
| capture() | Yes | 14+ distinct events captured across auth, checkout, team, and subscription flows |
| identify() | Yes | User identification on sign-in, sign-up, and account update with email, name, role properties |
| Error tracking | Yes | capture_exceptions: true in client config, captureException() calls in login, dashboard, pricing |
| Reverse proxy | Yes | Correctly configured in next.config.ts with /ingest rewrites to us.i.posthog.com |
Issues
- Client instrumentation pattern:
instrumentation-client.tsis a Next.js 15 App Router feature. For Pages Router, initialize PostHog in_app.tsxor use a custom<PostHogProvider>. [MEDIUM] - Server-side events may be lost:
posthog.capture()calls are not awaited and noflush()is called before response ends. In serverless/edge environments, events may be lost. Addawait posthog.flush()or useposthog.capture(...); await posthog.flush()pattern. [MEDIUM] - Duplicate event names: Client captures
user_logged_inwhile server capturesuser_signed_infor same action. Consider consistent naming. [LOW]
Other completed criteria
- API host correctly set to
/ingestfor reverse proxy ui_hostset tohttps://us.posthog.comfor toolbar/recordings- Debug mode enabled only in development
defaults: '2025-05-24'option includedskipTrailingSlashRedirect: trueadded for PostHog API compatibilityposthog.reset()called on sign-out
PostHog insights and events: 5/5 ✅
| Filename | PostHog events | Description |
|---|---|---|
components/header.tsx |
user_signed_out |
Captures sign-out with reset for session tracking |
components/login.tsx |
user_logged_in, user_signed_up, captureException |
Client-side auth events with invite tracking |
pages/api/auth/sign-in.ts |
user_signed_in |
Server-side with team_id, subscription status |
pages/api/auth/sign-up.ts |
user_signed_up, invitation_accepted |
Tracks invite flow separately for funnel analysis |
pages/api/account/update.ts |
account_updated |
Tracks profile changes with identify update |
pages/api/stripe/create-checkout.ts |
checkout_started |
Funnel entry point with plan context |
pages/api/stripe/checkout.ts |
checkout_completed |
Conversion event with subscription details |
pages/api/stripe/webhook.ts |
subscription_updated, subscription_cancelled |
Churn and upgrade tracking from Stripe webhooks |
pages/api/team/invite.ts |
team_member_invited |
Team growth tracking |
pages/api/team/remove-member.ts |
team_member_removed |
Team churn tracking |
pages/dashboard/index.tsx |
manage_subscription_clicked, captureException |
Engagement tracking |
pages/pricing.tsx |
pricing_plan_selected, captureException |
Pricing funnel with plan details |
Issues
None - event coverage is comprehensive and well-designed.
Other completed criteria
- Events cover full user lifecycle: signup → subscription → team management → churn
- Rich properties enable segmentation (team_id, plan_name, subscription_status)
- Source property (
api,stripe_webhook) enables channel analysis - Funnel-ready events:
pricing_plan_selected→checkout_started→checkout_completed - Team analytics:
team_member_invited→invitation_accepted→team_member_removed - Error tracking integrated into critical user flows
Reviewed by wizard workbench PR evaluator
Automated wizard CI run
Source: manual
Trigger ID:
3864784App:
next-js/15-pages-router-saasApp directory:
apps/next-js/15-pages-router-saasWorkbench branch:
wizard-ci-3864784-next-js-15-pages-router-saasWizard branch:
mainExamples branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-01-21T22:28:40.526Z
Duration: 545.2s