Repository navigation
[CI] (22322bc) next-js/15-pages-router-saas - #3649
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. It adds both client-side (
Confidence score: 5/5 🧙
File changes
App sanity check ✅
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js ^1.422.5 and posthog-node ^5.51.4 added to package.json |
| PostHog client initialized | Yes | Client initialized in _app.tsx at module scope with defaults: '2026-01-30'; server initialized as singleton in lib/posthog-server.ts with flushAt: 1, flushInterval: 0 |
| capture() | Yes | 9 server-side captures across API routes; 1 client-side capture (user_signed_out) |
| identify() | Yes | posthog.identify(String(user.id), { email, name, role }) in login handler and on page load via useEffect in header component |
| Error tracking | Yes | capture_exceptions: true in client init; enableExceptionAutocapture: true in server config |
| Reverse proxy | No | No reverse proxy configured for client-side events |
Issues
- No reverse proxy configured: Client-side PostHog events sent directly to
NEXT_PUBLIC_POSTHOG_HOSTwill be blocked by ad blockers. Configure Next.js rewrites or use PostHog's managed reverse proxy. [MEDIUM]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable - Host configured from
NEXT_PUBLIC_POSTHOG_HOSTenvironment variable posthog.reset()called on sign-out to clear identity- Identify uses stable
user.id(not email) as distinct_id - PII (email, name) correctly placed in identify person properties, not in capture event properties
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
components/header.tsx |
identify, user_signed_out, reset |
Identifies user on page load; captures sign-out and resets identity |
components/login.tsx |
identify |
Identifies user immediately after successful login/signup |
pages/api/auth/sign-in.ts |
user_signed_in |
Server-side sign-in with checkout_flow property |
pages/api/auth/sign-up.ts |
user_signed_up |
Server-side sign-up with checkout_flow and joined_via_invitation properties |
pages/api/stripe/create-checkout.ts |
checkout_started |
Captures checkout initiation with price_id |
pages/api/stripe/checkout.ts |
subscription_activated |
Captures successful subscription with subscription_status |
pages/api/stripe/customer-portal.ts |
subscription_management_opened |
Captures billing portal access |
pages/api/account/update.ts |
account_updated |
Captures account profile updates |
pages/api/team/invite.ts |
team_member_invited |
Captures team invitations with role |
pages/api/team/remove-member.ts |
team_member_removed |
Captures team member removal |
Other completed criteria
- Events represent real user actions across the full SaaS lifecycle (auth → billing → team management)
- Events enable product funnels: sign_up → checkout_started → subscription_activated
- Events include relevant properties (checkout_flow, price_id, subscription_status, role, joined_via_invitation)
- No PII in event properties — emails and names only in identify() person properties
- Consistent snake_case naming convention
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:
22322bcApp:
next-js/15-pages-router-saasApp directory:
apps/next-js/15-pages-router-saasWorkbench branch:
wizard-ci-22322bc-next-js-15-pages-router-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-08-28T19:25:52.638Z
Duration: 539.9s
YARA Scanner