[CI] (4c70a79) next-js/15-pages-router-saas - #3866
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 Pages Router SaaS app by adding
Confidence score: 5/5 🧙
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax or import errors; all files are valid TypeScript |
| Preserves existing env vars & configs | Yes | Existing env vars preserved; new PostHog vars added to .env.example |
| No syntax or type errors | Yes | All code is syntactically valid |
| Correct imports/exports | Yes | posthog-js correctly imported in client-side files only |
| Minimal, focused changes | Yes | API route changes are justified to enable client-side identify() |
| Pre-existing issues | None | — |
Issues
- API response shape modified:
sign-in.tsandsign-up.tsnow return auserobject in their responses. While needed for client-side identify, this changes the API contract. Any external consumers of these endpoints would receive additional data. [LOW]
Other completed criteria
- Environment variables documented in
.env.example - Build configuration valid with
posthog-jsadded to dependencies - PostHog guard checks (
process.env.NEXT_PUBLIC_POSTHOG_KEY) prevent errors when env vars are missing
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.429.0 added to package.json |
| PostHog client initialized | Yes | Initialized in instrumentation-client.ts with env-based key/host, exception capture, and dev debug |
| capture() | Yes | 7 meaningful capture calls across auth, dashboard, and pricing flows |
| identify() | Yes | Called on login (event handler) and on page load when user is available (useEffect); uses String(user.id) as distinct_id with email/name/role as person properties |
| Error tracking | Yes | capture_exceptions: true in init config enables automatic exception capture |
| Reverse proxy | No | No reverse proxy configured via Next.js rewrites or middleware |
Issues
- No reverse proxy: The app uses Next.js Pages Router which supports rewrites in
next.config.ts. A reverse proxy should be configured to prevent ad blockers from intercepting PostHog requests. Add rewrites for/ingest/*to the PostHog host. [MEDIUM] - Outdated defaults date:
defaults: '2026-01-30'should be'2026-05-30'per current docs. [LOW]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_KEYenvironment variable - Host correctly configured from
NEXT_PUBLIC_POSTHOG_HOSTenvironment variable posthog.reset()called on sign-out- Identify uses stable database user ID, not email
- Identify guard prevents redundant calls when
distinct_idalready matches
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
components/login.tsx |
user_signed_in, user_signed_up |
Auth events with auth_method property; enables sign-up funnel |
components/header.tsx |
user_signed_out |
Tracks sign-out and calls reset() |
pages/pricing.tsx |
checkout_started |
Tracks checkout initiation with plan_name, billing_interval, trial_days |
pages/dashboard/index.tsx |
subscription_management_opened, team_member_removed, team_member_invited |
Team and subscription management with invited_role property |
pages/dashboard/general.tsx |
account_updated |
Tracks account settings changes |
instrumentation-client.ts |
captureException (auto) |
Automatic exception capture via capture_exceptions: true |
Issues
- No issues — events are well-structured and actionable.
Other completed criteria
- Events represent real user actions in the SaaS product flow
- Events enable product insights: sign-up → checkout funnel, team management analysis, retention via sign-in frequency
- Events include relevant properties (plan details on checkout, role on invite)
- No PII in capture properties — email/name only in
identify()person properties - Consistent snake_case naming convention across all events
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:
4c70a79App:
next-js/15-pages-router-saasApp directory:
apps/next-js/15-pages-router-saasWorkbench branch:
wizard-ci-4c70a79-next-js-15-pages-router-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-09-09T22:25:56.841Z
Duration: 476.7s
YARA Scanner