Skip to content

[CI] (137243f) tanstack-router/tanstack-router-code-based-saas - #1970

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-137243f-tanstack-router-tanstack-router-code-based-saas
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-137243f-tanstack-router-tanstack-router-code-based-saas

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 137243f
App: tanstack-router/tanstack-router-code-based-saas
App directory: apps/tanstack-router/tanstack-router-code-based-saas
Workbench branch: wizard-ci-137243f-tanstack-router-tanstack-router-code-based-saas
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-06-18T16:28:07.919Z
Duration: 346.5s

@wizard-ci-bot

wizard-ci-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown
Author

Now I have enough context to write the full evaluation.


PR Evaluation Report

Summary

This PR integrates PostHog into a TanStack Router code-based SaaS demo app. It adds @posthog/react as a dependency, wraps the root component in PostHogProvider, captures six custom events across login, logout, invoice CRUD, team member views, and upgrade clicks, and configures a Vite dev-server reverse proxy for PostHog ingestion.

Files changed Lines added Lines removed
6 +121 -6

Confidence score: 3/5 🤔

  • posthog-js not in package.json: Only @posthog/react is listed as a dependency. @posthog/react is a peer-wrapper that depends on posthog-js — it must be explicitly installed. Without it, the build may fail or produce unexpected behavior depending on the package manager's hoisting. [CRITICAL]
  • identify() uses raw username as distinct_id: The login form accepts any arbitrary username string ("Demo: Enter any username to sign in"). Using a raw, user-typed string as distinct_id creates fragmented/colliding user profiles. A stable user ID from a database should be used. In a demo context this is partially mitigated, but the pattern is poor practice. [MEDIUM]
  • No .env.example committed: The .env file is gitignored (correct), but no .env.example was added to document the required environment variables (VITE_PUBLIC_POSTHOG_PROJECT_TOKEN, VITE_PUBLIC_POSTHOG_HOST, VITE_PUBLIC_POSTHOG_ASSETS_HOST). The report itself calls this out as a TODO. [MEDIUM]
  • Reverse proxy only works in dev: The Vite server.proxy config only applies during vite dev. In production, /ingest routes will 404 unless a separate production proxy is configured. This limits the reverse proxy's value. [MEDIUM]
  • user_name sent as event property in team_member_viewed: The capture call posthog.capture('team_member_viewed', { user_id: user.id, user_name: user.name }) includes a person's name as an event property, which is PII. [MEDIUM]

File changes

Filename Score Description
package.json 3/5 Adds @posthog/react but missing explicit posthog-js dependency
src/main.tsx 3/5 PostHogProvider wrapping, 6 capture calls, identify on login, reset on logout. Uses username as distinct_id, PII in event properties
vite.config.js 4/5 Dev-server reverse proxy for /ingest, /ingest/static, /ingest/array — well structured but dev-only
src/vite-env.d.ts 5/5 Vite client type reference — correct
.gitignore 5/5 Adds .env to gitignore — correct
posthog-setup-report.md 4/5 Thorough setup report with event table and next steps

App sanity check ⚠️

Criteria Result Description
App builds and runs No posthog-js is not an explicit dependency — @posthog/react has it as a peer dependency, so depending on package manager behavior the build may fail
Preserves existing env vars & configs Yes Existing code preserved; only PostHog additions made
No syntax or type errors Yes All syntax is valid TypeScript/JSX
Correct imports/exports Yes PostHogProvider and usePostHog correctly imported from @posthog/react
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None Base app appears functional

Issues

  • Missing posthog-js in dependencies: @posthog/react wraps posthog-js and expects it as a peer dependency. It should be explicitly listed in package.json. Add "posthog-js": "^1.x" to dependencies. [CRITICAL]
  • No .env.example: Three environment variables are required but undocumented in committed files. Add a .env.example with placeholder values. [MEDIUM]

Other completed criteria

  • .env is correctly gitignored
  • Vite config is valid and uses loadEnv properly
  • Existing app code and configs are preserved
  • TypeScript declarations added for Vite env

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed No Only @posthog/react added; posthog-js (the core SDK) is missing from package.json
PostHog client initialized Yes PostHogProvider with apiKey and options in RootComponent, including defaults, capture_exceptions, and api_host pointing to reverse proxy
capture() Yes 6 meaningful capture calls: user_logged_in, user_logged_out, invoice_created, invoice_updated, upgrade_plan_clicked, team_member_viewed
identify() Yes Called on login with posthog.identify(username, { username }), and posthog.reset() on both logout paths. However, uses raw username string as distinct_id which is fragile
Error tracking Yes capture_exceptions: true in init options enables automatic exception autocapture
Reverse proxy Yes Vite dev-server proxy configured for /ingest, /ingest/static, /ingest/array with correct targets. Dev-only limitation noted

Issues

  • Missing posthog-js dependency: The core SDK is not in package.json. @posthog/react depends on it. [CRITICAL]
  • Username as distinct_id: posthog.identify(username, { username }) uses the raw form input as the distinct ID. This demo's "enter any username" pattern means distinct IDs are arbitrary strings that could collide or fragment. In a real app, a stable database ID should be used. [MEDIUM]
  • Dev-only reverse proxy: The Vite server.proxy only works in development. In production, the /ingest path will not resolve without additional infrastructure (e.g., Vercel rewrites, nginx). [MEDIUM]

Other completed criteria

  • API key loaded from import.meta.env.VITE_PUBLIC_POSTHOG_PROJECT_TOKEN (not hardcoded)
  • Host configured via environment variable through reverse proxy
  • posthog.reset() correctly called on both logout paths
  • ui_host set to allow toolbar functionality through the proxy
  • defaults: '2026-01-30' included per docs

PostHog insights and events ⚠️

Filename PostHog events Description
src/main.tsx user_logged_in Captured on login form submission with { username } property
src/main.tsx user_logged_out Captured on both logout buttons (profile page and login page)
src/main.tsx invoice_created Captured in mutation onSuccess with { invoice_id, invoice_title }
src/main.tsx invoice_updated Captured in mutation onSuccess with { invoice_id, invoice_title }
src/main.tsx upgrade_plan_clicked Captured on upgrade button click, no properties
src/main.tsx team_member_viewed Captured on team member link click with { user_id, user_name }
src/main.tsx captureException (auto) Enabled via capture_exceptions: true in init config

Issues

  • PII in team_member_viewed event properties: user_name (a person's name) is sent as an event property. Names are PII and should be set via person properties (``), not in capture() event properties. [MEDIUM]
  • PII in user_logged_in event properties: username is sent as an event property. While also set as a person property via identify(), it should not be duplicated in the capture call's event properties. [LOW]

Other completed criteria

  • Events represent real user actions (login, logout, create, update, view, upgrade)
  • Events enable product insights — can build login→invoice_created funnel, upgrade conversion, team engagement trends
  • Invoice events include enriched properties (invoice_id, invoice_title)
  • Event names are descriptive and use consistent snake_case convention

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants