-
Notifications
You must be signed in to change notification settings - Fork 0
[CI] (9688d07) next-js/15-app-router-saas #244
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 locally. I'll evaluate the PR based on the detailed diff provided in the PR description. PR Evaluation ReportSummaryThis PR adds PostHog analytics integration to a Next.js 15 SaaS application. It installs both
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 lib/posthog-server.ts singleton |
| capture() | Yes | 9 capture calls across actions.ts and checkout/route.ts |
| identify() | Yes | Server-side identify on sign-in/sign-up, client-side identify in login.tsx |
| Error tracking | Yes | capture_exceptions: true in client initialization |
| Reverse proxy | Yes | Next.js rewrites to us.i.posthog.com and us-assets.i.posthog.com |
Issues
- Server-side events may be lost in serverless: The
posthog-nodeclient is created withflushAt: 1, flushInterval: 0, which means it should flush after every event. However, in serverless environments, the process may terminate before the HTTP request completes. The exportedshutdownPostHog()function is never called anywhere. Each server action should eitherawait posthog.flush()or the app should use a shutdown hook. [CRITICAL] - Server host configuration potentially broken:
lib/posthog-server.tsusesprocess.env.NEXT_PUBLIC_POSTHOG_HOSTwhich may be undefined or incorrectly set. The client init uses/ingest(the proxy), but the server should use the direct PostHog URL since server-to-server doesn't need the proxy. [CRITICAL] - Session ID correlation may fail: The client passes
posthog_session_idto the server via form data, butposthog.get_session_id()may return undefined before a session is established. [LOW]
Other completed criteria
- Uses environment variables for API key (not hardcoded)
- Client initialization uses modern
defaults: '2025-05-24'setting - Debug mode enabled in development only
- Proper proxy configuration with static assets and API routes
skipTrailingSlashRedirectenabled for PostHog compatibility
PostHog insights and events: 4/5 ✅
| Filename | PostHog events | Description |
|---|---|---|
app/(login)/actions.ts |
user_signed_up, user_signed_in, user_signed_out, password_updated, account_deleted, account_updated, team_member_removed, team_member_invited |
Core user lifecycle and team management events with rich properties (user_id, team_id, email) |
app/api/stripe/checkout/route.ts |
checkout_completed |
Captures successful Stripe checkout with plan name, price, subscription status, and currency |
instrumentation-client.ts |
`` (automatic) | Exception capture enabled for automatic error tracking |
Issues
- Missing events documented but not implemented: The
.posthog-events.jsonlistscheckout_started,subscription_updated, andpricing_page_viewed, but these are not implemented in the PR diff. Either implement them or remove from the events file. [MEDIUM] - No automatic pageview tracking: Client-side pageview tracking is not configured. PostHog defaults typically capture pageviews, but this should be verified. [LOW]
Other completed criteria
- Events represent real user actions and product flows
- Events enriched with relevant properties (user_id, team_id, email, plan details)
- Events cover key conversion funnel (signup → checkout)
- Churn tracking via
account_deletedevent - Team collaboration tracking via invite/remove events
- Session ID correlation attempted for client-server event stitching
Reviewed by wizard workbench PR evaluator
Automated wizard CI run
Source: wizard-pr
Trigger ID:
9688d07App:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-9688d07-next-js-15-app-router-saasWizard branch:
matt/mcp-eu-subdomainExamples branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-01-21T21:14:18.378Z
Duration: 232.2s