Repository navigation
[CI] (33127b6) next-js/15-pages-router-saas - #3671
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
wizard-ci-bot[bot] wants to merge 1 commit into
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 Pages Router SaaS application, adding both client-side (
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | All syntax is valid, imports resolve, no type errors |
| Preserves existing env vars & configs | Yes | Existing .env.example entries preserved, additions are additive |
| No syntax or type errors | Yes | TypeScript is correct throughout |
| Correct imports/exports | Yes | posthog-js on client, posthog-node on server — correct separation |
| Minimal, focused changes | No | API response shapes for sign-in/sign-up were modified to include user data |
| Pre-existing issues | None | Base app appears functional |
Issues
- API response shape modification: The sign-in and sign-up API endpoints now include a
userobject in their responses. While necessary for client-side identification, this changes the API contract. Any external consumers of these endpoints would receive unexpected extra fields. [MEDIUM]
Other completed criteria
- Environment variables documented in
.env.example - Build configuration valid —
package.jsonhas correct dependency entries posthog-nodecorrectly used only in server-side API routesposthog-jscorrectly used only in client-side components
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.422.5 and posthog-node@^5.51.4 in package.json |
| PostHog client initialized | Yes | Client via instrumentation-client.ts (correct for Next.js), server via singleton in lib/posthog-server.ts |
| capture() | Yes | 10+ meaningful capture calls across client and server |
| identify() | Yes | posthog.identify(String(user.id), {...}) on login and on page load via PostHogIdentify component |
| Error tracking | Yes | Custom PostHogErrorBoundary with captureException + capture_exceptions: true in init config |
| Reverse proxy | No | next.config.ts has no rewrites configured for proxying PostHog requests |
Issues
- No reverse proxy: Client-side PostHog requests go directly to
us.i.posthog.com, making them susceptible to ad blockers. Next.js rewrites should proxy/ingest/*tous.i.posthog.comand/ingest/static/*tous-assets.i.posthog.com. [MEDIUM]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenv var (not hardcoded) - Host correctly configured via
NEXT_PUBLIC_POSTHOG_HOSTenv var - User identification uses stable database ID (
String(user.id)) — correct approach posthog.reset()called on sign-out — correct- Identification on page refresh via
PostHogIdentifycomponent fetching/api/user - Server-side uses
flushAt: 1andflushInterval: 0per Next.js docs recommendation - Email/name passed as person properties in
identify(), not incapture()— correct
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
components/login.tsx |
user_signed_in, user_signed_up |
Client-side auth events with identification |
components/header.tsx |
user_signed_out |
Sign-out event followed by reset() |
pages/_app.tsx |
captureException |
Error boundary catches React component errors |
pages/api/account/update.ts |
account_updated |
Server-side account update tracking |
pages/api/stripe/checkout.ts |
checkout_completed |
Stripe checkout completion with plan name |
pages/api/stripe/create-checkout.ts |
checkout_started |
Checkout initiation tracking |
pages/api/stripe/customer-portal.ts |
billing_portal_opened |
Billing portal access tracking |
pages/api/team/invite.ts |
team_member_invited |
Team invite with role property |
pages/api/team/remove-member.ts |
team_member_removed |
Team member removal tracking |
Issues
No issues — events are well-structured and map to real product flows.
Other completed criteria
- Events represent real user actions across auth, billing, and team management flows
- Events enable product insights — full signup → checkout → team management funnel is trackable
- Several events include enriched properties (
plan_name,invited_role,component_stack) - No PII in capture properties — email/name only in
identify()person properties - Event names follow consistent
snake_caseconvention and are descriptive
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
Source: wizard-pr
Trigger ID:
33127b6App:
next-js/15-pages-router-saasApp directory:
apps/next-js/15-pages-router-saasWorkbench branch:
wizard-ci-33127b6-next-js-15-pages-router-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-08-28T22:33:08.840Z
Duration: 489.6s
YARA Scanner