Repository navigation
[CI] (a5131dd) next-js/15-app-router-saas - #2475
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 App Router SaaS application with comprehensive client-side and server-side tracking. Client-side initialization uses
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors; all imports resolve to existing modules |
| Preserves existing env vars & configs | Yes | Existing configs untouched except adding rewrites and skipTrailingSlashRedirect |
| No syntax or type errors | Yes | Valid TypeScript throughout |
| Correct imports/exports | Yes | posthog-js imported client-side, posthog-node server-side; getTeamByStripeCustomerId exists in queries |
| Minimal, focused changes | No | Gratuitous single-to-double quote reformatting across actions.ts and other files |
| Pre-existing issues | None | Base app is clean |
Issues
- Env vars not documented:
.env.exampleis missingNEXT_PUBLIC_POSTHOG_PROJECT_TOKENandNEXT_PUBLIC_POSTHOG_HOST. New developers or CI pipelines won't know these are required. Add them to.env.example. [MEDIUM] - Quote style reformatting:
actions.tsand other files have hundreds of lines changed from single to double quotes. This obscures the actual PostHog changes and makes code review harder. [MEDIUM]
Other completed criteria
- Build configuration is valid —
package.jsonproperly lists both PostHog dependencies .gitignorecorrectly excludes.env.local
PostHog implementation ✅
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.398.2 and posthog-node@^5.40.0 in package.json |
| PostHog client initialized | Yes | Client via instrumentation-client.ts with posthog.init(); server via singleton in lib/posthog-server.ts with flushAt: 1, flushInterval: 0 |
| capture() | Yes | 12 distinct server-side events plus client-side autocapture |
| identify() | Yes | Client-side posthog.identify(String(user.id), {email, name, role}) in dashboard layout; server-side posthog.identify() on sign-in/sign-up; posthog.reset() on sign-out |
| Error tracking | Yes | capture_exceptions: true in client init config |
| Reverse proxy | Yes | Next.js rewrites in next.config.ts: /ingest/static/* and /ingest/array/* → us-assets.i.posthog.com, /ingest/* → us.i.posthog.com |
Issues
- Older defaults date:
instrumentation-client.tsusesdefaults: "2026-01-30"while current docs recommend"2026-05-30". This means slightly older default configuration. [LOW]
Other completed criteria
- API key loaded from
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable (not hardcoded) - Host correctly configured — client uses
/ingestreverse proxy, server usesNEXT_PUBLIC_POSTHOG_HOSTenv var ui_hostcorrectly set tohttps://us.posthog.comwhen using reverse proxy (needed for toolbar/surveys)skipTrailingSlashRedirect: trueadded for reverse proxy compatibility- Server-side client uses singleton pattern appropriate for Next.js App Router
posthog.reset()called on logout in client-side code
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
app/(dashboard)/layout.tsx |
identify, reset |
Identifies authenticated user on dashboard load with user.id, resets on sign-out |
app/(login)/actions.ts |
user_signed_in, user_signed_up, user_signed_out, invitation_accepted, password_updated, account_updated, account_deleted, team_member_removed, team_member_invited |
Full auth and team management lifecycle tracked server-side with team context |
app/api/stripe/checkout/route.ts |
checkout_completed |
Captures plan name, subscription ID, and team ID on successful checkout |
app/api/stripe/webhook/route.ts |
subscription_updated |
Tracks subscription status changes from Stripe webhooks with subscription details |
lib/payments/actions.ts |
checkout_initiated |
Captures when user starts checkout with price ID and current plan |
instrumentation-client.ts |
captureException (automatic) |
Error tracking via capture_exceptions: true |
Issues
None — events are well-structured and cover the complete user lifecycle.
Other completed criteria
- Events represent real user actions (signup, login, checkout, subscription changes, team management)
- Events enable product insights — signup → checkout → subscription funnel is fully instrumented
- All events include enriched properties (team_id, plan_name, role, subscription_status, etc.)
- No PII in capture properties — email/name only set via
identify()person properties - Event names follow consistent
snake_caseconvention and are descriptive of the action
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:
a5131ddApp:
next-js/15-app-router-saasApp directory:
apps/next-js/15-app-router-saasWorkbench branch:
wizard-ci-a5131dd-next-js-15-app-router-saasWizard branch:
fix/warlock-smoke-test-remove-killswitchContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-07T21:48:04.347Z
Duration: 689.9s
YARA Scanner