Skip to content

[CI] (9da603e) tanstack-router/tanstack-router-code-based-saas - #4409

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

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

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 9da603e
App: tanstack-router/tanstack-router-code-based-saas
App directory: apps/tanstack-router/tanstack-router-code-based-saas
Workbench branch: wizard-ci-9da603e-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-10-06T16:05:50.403Z
Duration: 366.3s

YARA Scanner

✓ 140 tool calls scanned, 0 violations detected

No violations: ✓ 140 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a TanStack Router code-based SPA using posthog-js and @posthog/react. It adds the PostHogProvider and PostHogErrorBoundary wrappers, captures custom events for invoice CRUD and auth flows, and includes environment variable setup. However, it omits user identification on login and reset() on logout, and no reverse proxy is configured.

Files changed Lines added Lines removed
5 +65 -4

Confidence score: 5/5 🧙

  • Missing posthog.identify() on login: The app has an auth flow (auth.login(username)) but never calls posthog.identify(). All events remain anonymous and cannot be tied to the logged-in user. Add posthog.identify(username) after auth.login(username) in LoginComponent.onSubmit. [CRITICAL]
  • Missing posthog.reset() on logout: Two logout handlers call auth.logout() but never call posthog.reset(). The next user on the same browser inherits the previous user's identity. Add posthog.reset() before or after auth.logout(). [CRITICAL]
  • No reverse proxy configured: Client-side PostHog requests are sent directly to posthog.com and will be blocked by ad blockers, silently dropping events. Configure a reverse proxy (e.g., Vite dev server proxy + production reverse proxy). [MEDIUM]
  • Events lack contextual properties: All capture() calls are bare (e.g., posthog.capture('invoice_created') with no properties). Adding properties like invoice_id, invoice_amount, or username_length would make these events useful for product analysis. [MEDIUM]

File changes

Filename Score Description
.env.example 5/5 New file documenting required PostHog env vars
.gitignore 5/5 Adds .env to prevent committing secrets
package.json 5/5 Adds posthog-js and @posthog/react dependencies
src/main.tsx 3/5 Core integration with provider, error boundary, and captures — but missing identify/reset and event properties
tsconfig.json 5/5 Adds vite/client types for import.meta.env type safety

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors; dependencies and imports are correct
Preserves existing env vars & configs Yes Existing code wrapped non-destructively; only PostHog additions made
No syntax or type errors Yes All JSX, imports, and TypeScript usage appear valid
Correct imports/exports Yes PostHogErrorBoundary, PostHogProvider, usePostHog correctly imported from @posthog/react
Minimal, focused changes Yes All changes directly support PostHog integration
Pre-existing issues None —

Issues

No issues in this section.

Other completed criteria

  • Environment variables documented in .env.example
  • .env added to .gitignore to protect secrets
  • vite/client types added for import.meta.env IntelliSense
  • Build configuration valid with correct dependency versions

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js ^1.438.1 and @posthog/react ^1.11.3 added to package.json
PostHog client initialized Yes PostHogProvider with apiKey and options including api_host, defaults, capture_exceptions, logs, and debug
capture() Yes Four meaningful events: invoice_created, invoice_updated, user_logged_in, user_logged_out
identify() No No posthog.identify() call despite having a login flow with auth.login(username)
Error tracking Yes PostHogErrorBoundary wraps the app and capture_exceptions: true is set in init options
Reverse proxy No No reverse proxy configured; events sent directly to PostHog host

Issues

  • No user identification on login: The app captures user_logged_in but never calls posthog.identify(username). All events remain anonymous, defeating the purpose of tracking user behavior across sessions. Add posthog.identify(username) in the onSubmit handler after auth.login(username). [CRITICAL]
  • No posthog.reset() on logout: Both logout handlers (in ProfileComponent) call auth.logout() without posthog.reset(). Subsequent users on the same browser inherit the previous identity. Add posthog.reset() alongside auth.logout(). [CRITICAL]
  • No reverse proxy: Direct requests to PostHog are commonly blocked by ad blockers and privacy extensions. Set up a reverse proxy to improve event delivery reliability. [MEDIUM]

Other completed criteria

  • API key loaded from VITE_PUBLIC_POSTHOG_PROJECT_TOKEN env var (not hardcoded)
  • API host loaded from VITE_PUBLIC_POSTHOG_HOST env var
  • Good defensive check: in DEV mode, throws an error if env vars are missing; in production, gracefully falls back to rendering children without PostHog
  • Logs capture configured with serviceName and environment
  • Debug mode enabled only in development

PostHog insights and events ⚠️

Filename PostHog events Description
src/main.tsx invoice_created Captured on successful invoice creation mutation — no properties attached
src/main.tsx invoice_updated Captured on successful invoice update mutation — no properties attached
src/main.tsx user_logged_in Captured after auth.login() — no user properties or identify call
src/main.tsx user_logged_out Captured on logout button click (2 locations) — no reset call
src/main.tsx captureException Via PostHogErrorBoundary wrapping + capture_exceptions: true for uncaught errors

Issues

  • Events have no contextual properties: Every capture() call is bare — e.g., posthog.capture('invoice_created') sends no invoice ID, amount, status, or other properties. This makes it impossible to segment, filter, or build meaningful insights beyond raw counts. Add relevant properties like { invoice_id, total, status }. [MEDIUM]

Other completed criteria

  • Events represent real user actions (login, logout, create/update invoices)
  • Events enable product insights — can build a basic login → invoice creation funnel
  • Event names use consistent snake_case convention with descriptive action names
  • No PII placed in event properties

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