Skip to content

[CI] (8dccaac) tanstack-router/tanstack-router-file-based-saas - #2372

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-8dccaac-tanstack-router-tanstack-router-file-based-saas
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-8dccaac-tanstack-router-tanstack-router-file-based-saas

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 8dccaac
App: tanstack-router/tanstack-router-file-based-saas
App directory: apps/tanstack-router/tanstack-router-file-based-saas
Workbench branch: wizard-ci-8dccaac-tanstack-router-tanstack-router-file-based-saas
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-03T01:00:01.008Z
Duration: 407.9s

YARA Scanner

✓ 49 tool calls scanned, 0 violations detected

No violations: ✓ 49 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a TanStack Router file-based SaaS app (React client-only). It adds posthog-js and @posthog/react, initializes via PostHogProvider in the root route, configures a Vite dev-server reverse proxy, and instruments eight business events across five route files with user identification on login and reset on logout.

Files changed Lines added Lines removed
11 +127 -13

Confidence score: 4/5 👍

  • PII in event properties: username is passed as an event property in user_signed_in and user_signed_out capture calls. Since posthog.identify(username, { username }) already sets this as a person property, it should be removed from capture properties. Invoice title (user-generated content) is also leaked into invoice_created and invoice_updated event properties. [CRITICAL]
  • No .env.example or documentation for env vars: VITE_PUBLIC_POSTHOG_PROJECT_TOKEN and VITE_PUBLIC_POSTHOG_HOST are required but not documented in any example file. [MEDIUM]
  • Returning users not re-identified: posthog.identify() is only called on login form submit. Users who return already authenticated will browse with anonymous distinct IDs until they log out and back in. Should call identify in the root route when the user is already logged in. [MEDIUM]

File changes

Filename Score Description
src/routes/__root.tsx 4/5 Wraps app in PostHogProvider with env-based config, reverse proxy host, and exception autocapture
src/routes/login.tsx 3/5 Adds identify/reset and sign-in/sign-out events, but leaks username as event property
src/routes/dashboard.invoices..tsx 3/5 Adds invoice_viewed, invoice_updated, invoice_notes_toggled events; title is user-generated content in properties
src/routes/dashboard.invoices.index.tsx 3/5 Adds invoice_created event; title leaked as user-generated content
src/routes/_auth.profile.tsx 5/5 Clean upgrade_clicked event with plan context property
src/routes/dashboard.users.route.tsx 5/5 Clean team_member_sorted event in event handler
vite.config.js 5/5 Correct reverse proxy with /static, /array, and catch-all /ingest routes
package.json 5/5 Adds posthog-js and @posthog/react
tsconfig.json 5/5 Adds vite/client types for import.meta.env
.gitignore 5/5 Adds .env to gitignore
posthog-setup-report.md 4/5 Wizard report with event table and next steps

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax or structural errors introduced
Preserves existing env vars & configs Yes Existing code preserved; only PostHog additions made
No syntax or type errors Yes Valid TypeScript/JSX throughout
Correct imports/exports Yes @posthog/react and posthog-js imports are correct
Minimal, focused changes Yes All changes are PostHog-related
Pre-existing issues None —

Issues

  • Missing .env.example: VITE_PUBLIC_POSTHOG_PROJECT_TOKEN and VITE_PUBLIC_POSTHOG_HOST are not documented in any example env file. New contributors won't know which variables to set. [MEDIUM]

Other completed criteria

  • .gitignore correctly updated to exclude .env
  • tsconfig.json updated with vite/client types for proper import.meta.env typing
  • Build configuration remains valid with proxy additions

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js@^1.396.5 and @posthog/react@^1.10.3 added to dependencies
PostHog client initialized Yes PostHogProvider in __root.tsx with apiKey from env, capture_exceptions enabled
capture() Yes 8 meaningful events across 5 route files
identify() Yes Called on login with username; reset() on logout
Error tracking Yes capture_exceptions: true in PostHogProvider options enables exception autocapture
Reverse proxy Yes Vite dev-server proxy at /ingest with correct /static and /array routes to us-assets.i.posthog.com

Issues

  • Returning users not re-identified: identify() is only called on login form submit. Users who return with an active session browse anonymously until they explicitly log out and back in. Add an identify call in the root route (or an auth-aware wrapper) when auth.status === 'loggedIn'. [MEDIUM]
  • Dev-only reverse proxy: The Vite server.proxy only applies during development. Production deployments need a separate proxy configuration (e.g., Nginx, Cloudflare, Vercel rewrites). This is noted but not addressed. [LOW]

Other completed criteria

  • API key loaded from import.meta.env.VITE_PUBLIC_POSTHOG_PROJECT_TOKEN (not hardcoded)
  • Host correctly configured via reverse proxy with ui_host fallback
  • Reverse proxy routes both /ingest/static and /ingest/array to assets origin
  • posthog.reset() correctly called before auth.logout()

PostHog insights and events ⚠️

Filename PostHog events Description
login.tsx user_signed_in, user_signed_out Tracks auth lifecycle; identify on login, reset on logout
dashboard.invoices..tsx invoice_viewed, invoice_updated, invoice_notes_toggled Invoice detail page interactions; viewed on mount, updated on save
dashboard.invoices.index.tsx invoice_created Tracks new invoice creation in onSuccess callback
_auth.profile.tsx upgrade_clicked Conversion intent signal with current plan context
dashboard.users.route.tsx team_member_sorted Tracks sort preference changes

Issues

  • PII in event properties (username): user_signed_in and user_signed_out events include { username } as an event property. Since posthog.identify(username, { username }) already sets this as a person property, the username should be removed from capture() properties. PII belongs in person properties only. [CRITICAL]
  • User-generated content in event properties (title): invoice_created, invoice_updated, and invoice_viewed events include the invoice title as an event property. This is user-generated content that should not be in event properties per PostHog best practices. Use invoice_id alone for correlation. [MEDIUM]

Other completed criteria

  • Events represent real user actions mapped to actual product flows (auth, invoicing, upgrade, team management)
  • Events enable product insights: sign-in → invoice view → invoice create funnel is possible
  • Events include relevant contextual properties (invoice_id, sort_by, current_plan, notes_visible)
  • Event names are descriptive and consistently use 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