[CI] (tune-54-med) next-js/15-app-router-saas#2408
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
|
Now I have all the context I need. Let me produce the evaluation report. PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 App Router SaaS application. It adds both client-side (
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | Code is syntactically correct; build blocked only by pre-existing missing POSTGRES_URL |
| Preserves existing env vars & configs | Yes | Existing configs preserved; only PostHog additions made |
| No syntax or type errors | Yes | All TypeScript usage is correct; *Immediate methods confirmed to exist in posthog-node v5.39.4 |
| Correct imports/exports | Yes | All imports are valid — posthog-js client-side, posthog-node server-side, server-only guard on server module |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | Missing POSTGRES_URL prevents full build verification |
Issues
- Environment variables not documented in .env.example:
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENandNEXT_PUBLIC_POSTHOG_HOSTare missing from.env.example. Add them so collaborators know what to configure. [MEDIUM]
Other completed criteria
- Build configuration is valid with correct
rewritesandskipTrailingSlashRedirectin next.config.ts server-onlyimport inlib/posthog-server.tscorrectly prevents accidental client-side usage- No existing functionality broken — form actions, auth flows, and Stripe integrations preserved
PostHog implementation ✅
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.396.6 and posthog-node@^5.39.4 in package.json |
| PostHog client initialized | Yes | Client: instrumentation-client.ts with posthog.init(). Server: singleton PostHog instance in lib/posthog-server.ts with flushAt:1, flushInterval:0 |
| capture() | Yes | Multiple meaningful capture() calls on both client and server |
| identify() | Yes | Client-side posthog.identify(user.id.toString(), { role }) in dashboard layout; server-side identifyImmediate on sign-in/sign-up; posthog.reset() on logout |
| Error tracking | Yes | capture_exceptions: true in init config enables autocapture; captureServerException used for Stripe errors |
| Reverse proxy | Yes | Next.js rewrites in next.config.ts correctly route /ingest/static/* and /ingest/array/* to assets host, and /ingest/* to API host; api_host: '/ingest' and ui_host configured |
Other completed criteria
- API key loaded from
process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable (not hardcoded in source) - Host correctly configured via
process.env.NEXT_PUBLIC_POSTHOG_HOST - Reverse proxy correctly derives assets host by replacing
//us.with//us-assets.and//eu.with//eu-assets. defaults: '2026-05-30'set per current docsdebugmode correctly conditional on development environment
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
app/(login)/login.tsx |
sign_in_submitted, sign_up_submitted |
Client-side form submission tracking with redirect and invite context |
app/(login)/actions.ts |
user_signed_in, user_signed_up, password_updated, account_deleted, account_updated, team_member_removed, team_member_invited |
Server-side auth and team management events with enriched properties |
app/(dashboard)/pricing/submit-button.tsx |
pricing_cta_clicked |
Client-side pricing CTA click |
lib/payments/actions.ts |
checkout_started, billing_portal_opened |
Server-side billing flow events |
app/api/stripe/checkout/route.ts |
subscription_checkout_completed, captureServerException |
Checkout completion and error tracking |
app/api/stripe/webhook/route.ts |
subscription_webhook_processed, captureServerException |
Webhook processing and signature verification errors |
app/(dashboard)/layout.tsx |
identify, reset |
User identification on load and reset on logout |
Other completed criteria
- Events represent real user actions mapping to actual product flows (auth, billing, team management)
- Events enable product insights — can build auth funnels (submitted → signed in), billing funnels (CTA → checkout → completed), and team management trends
- Events include enriched properties (
team_id,authentication_flow,stripe_subscription_status,plan_name, etc.) - No PII in event properties — only role, team_id, booleans, and status fields; email/name not sent in capture properties
- Event names follow consistent
snake_caseconvention with descriptive action names
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: manual
Trigger ID:
tune-54-medApp:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-tune-54-med-next-js-15-app-router-saasWizard branch:
9f76b79948dd91bde15b8ff25aba5c96df50d5d3Context Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-03T17:19:23.092Z
Duration: 1361.3s
YARA Scanner