[CI] (8ac6d56) next-js/15-pages-router-saas#161
Closed
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
Closed
[CI] (8ac6d56) next-js/15-pages-router-saas#161wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
Conversation
Author
|
Now I have read all the changed files. Let me compile my evaluation report. PR Evaluation ReportSummaryThis PR integrates PostHog analytics into a Next.js 15 Pages Router SaaS application. It adds client-side initialization via
Confidence score: 3/5 🤔
File changes
App sanity check: 2/5 ❌
Issues
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.321.2 and posthog-node@^5.21.0 added to dependencies |
| PostHog client initialized | Partial | Client-side init in wrong file for Pages Router; server-side singleton pattern correct |
| capture() | Yes | Multiple capture calls across client and server-side code |
| identify() | Yes | User identification on both client (login.tsx) and server (sign-in, sign-up APIs) |
| Error tracking | Yes | capture_exceptions: true configured in client init |
| Reverse proxy | Yes | /ingest/* rewrites configured in next.config.ts with skipTrailingSlashRedirect |
Issues
- Client-side PostHog won't initialize:
instrumentation-client.tsis not supported in Pages Router. Need to initialize in_app.tsxwithuseEffector wrap the app withPostHogProvider. [CRITICAL] - Server-side events may be lost: API routes capture events but never call
posthog.flush()orawait posthog.shutdown(). With serverless, the process may terminate before events are sent. [MEDIUM] - Invalid
defaultsoption: Thedefaults: '2025-05-24'config option doesn't exist in PostHog JS SDK. [MEDIUM] - Webhook uses Stripe customer ID as distinctId:
subscription.customeris a Stripe customer ID (cus_xxx), not the user's email or PostHog distinct ID, which breaks identity resolution. [MEDIUM]
Other completed criteria
- Proper API host configuration via reverse proxy (
/ingest) - UI host correctly set to
https://us.posthog.com - Debug mode enabled only in development
posthog.reset()called on sign-out- No PII beyond email in event properties
PostHog insights and events: 4/5 ✅
| Filename | PostHog events | Description |
|---|---|---|
components/header.tsx |
user_signed_out |
Tracks sign-out with PostHog reset for clean session separation |
components/login.tsx |
identify |
Identifies user by email after successful authentication |
pages/api/auth/sign-in.ts |
user_signed_in, identify |
Server-side sign-in tracking with user properties |
pages/api/auth/sign-up.ts |
user_signed_up, identify |
Tracks new user creation with invitation status |
pages/api/stripe/create-checkout.ts |
checkout_started |
Captures checkout initiation with priceId and teamId |
pages/api/stripe/checkout.ts |
checkout_completed |
Tracks successful subscription activation with plan details |
pages/api/stripe/webhook.ts |
subscription_updated, subscription_cancelled |
Webhook events for subscription lifecycle |
pages/api/team/invite.ts |
team_member_invited |
Tracks team invitations with role and email |
pages/api/team/remove-member.ts |
team_member_removed |
Tracks member removal from teams |
pages/api/account/update.ts |
account_updated |
Tracks profile updates with fields changed |
pages/pricing.tsx |
pricing_plan_selected |
Client-side tracking of pricing page interactions |
Issues
- Webhook distinctId breaks identity: Stripe webhook events use
subscription.customer(Stripe ID) instead of user email, making these events disconnected from the user's PostHog identity. [MEDIUM] - Missing pageview tracking: No automatic pageview tracking configured - would require manual setup in
_app.tsx. [LOW]
Other completed criteria
- Events cover full user lifecycle: sign-up → sign-in → checkout → subscription management → sign-out
- Events include relevant context properties (teamId, source, etc.)
- Supports funnel analysis: pricing_plan_selected → checkout_started → checkout_completed
- Team management events enable growth analysis
- Account update events indicate engagement
Reviewed by wizard workbench PR evaluator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated wizard CI run
Trigger ID:
8ac6d56App:
next-js/15-pages-router-saasApp directory:
apps/next-js/15-pages-router-saasWorkbench branch:
wizard-ci-8ac6d56-next-js-15-pages-router-saasWizard branch:
feat-skill-based-integrationExamples branch:
test-skills-ciPostHog (MCP) branch:
feat-mcp-skill-deploymentTimestamp: 2026-01-14T21:27:54.891Z
Duration: 422.5s