Skip to content

[CI] (624abe2) tanstack-router/tanstack-router-code-based-saas - #4471

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

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

Conversation

@wizard-ci-bot

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

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 624abe2
App: tanstack-router/tanstack-router-code-based-saas
App directory: apps/tanstack-router/tanstack-router-code-based-saas
Workbench branch: wizard-ci-624abe2-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-08T09:30:15.973Z
Duration: 337.0s

YARA Scanner

✓ 145 tool calls scanned, 0 violations detected

No violations: ✓ 145 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Author

Now I have all the context I need. The app has a demo auth system with username available, and posthog.identify() is never called despite having login/logout flows. Also posthog.reset() is never called on logout.


PR Evaluation Report

Summary

This PR adds PostHog integration to a TanStack Router code-based SaaS demo app using @posthog/react. It wraps the app in PostHogProvider, captures custom events for invoice creation/update and login/logout flows, and adds error tracking and log capture configuration.

Files changed Lines added Lines removed
5 +63 -1

Confidence score: 4/5 👍

  • Missing posthog.identify() on login: The app has a clear login flow with auth.login(username) but never calls posthog.identify() to link events to the user. This means all events remain anonymous and cannot be associated with specific users. [CRITICAL]
  • Missing posthog.reset() on logout: The app has two logout buttons that call auth.logout() but never call posthog.reset(), so subsequent users on the same browser inherit the previous session identity. [CRITICAL]
  • No reverse proxy configured: The app sends events directly to the PostHog host, making them susceptible to ad blocker interception. [MEDIUM]
  • Missing defaults option: The PostHogProvider options don't include defaults: '2026-05-30' as recommended in all PostHog docs examples. [MEDIUM]
  • posthog-js not explicitly in dependencies: Only @posthog/react is listed. While npm 7+ auto-installs peer dependencies, explicitly adding posthog-js is more reliable. [LOW]

File changes

Filename Score Description
.env.example 4/5 New file with PostHog env vars using VITE_PUBLIC_ prefix
.gitignore 5/5 Adds .env to prevent secrets from being committed
package.json 3/5 Adds @posthog/react but missing explicit posthog-js dependency
src/main.tsx 3/5 Core integration: PostHogProvider, capture calls, but missing identify/reset
tsconfig.json 5/5 Adds vite/client types for import.meta.env support

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Valid TypeScript, proper imports, Vite env vars correctly typed
Preserves existing env vars & configs Yes Only adds new env vars and PostHog-related config
No syntax or type errors Yes All code is syntactically valid; optional chaining used correctly
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 is clean

Issues

  • Missing posthog-js explicit dependency: @posthog/react lists posthog-js as a peer dependency. While npm 7+ resolves this automatically, explicit declaration is safer, especially across different package managers. [LOW]

Other completed criteria

  • Environment variables documented in .env.example
  • .env added to .gitignore
  • tsconfig.json updated with vite/client types for import.meta.env type safety
  • Dev-only guard throws helpful errors when env vars are missing
  • Build configuration remains valid

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes @posthog/react ^1.11.3 added to dependencies
PostHog client initialized Yes PostHogProvider wraps the app with apiKey and options including api_host
capture() Yes Four meaningful capture calls: invoice_creation_submitted, invoice_update_submitted, user_logged_in, user_logged_out
identify() No Not implemented despite having a clear login flow with username available
Error tracking Yes capture_exceptions: true enabled in PostHogProvider options
Reverse proxy No Not configured; events sent directly to PostHog host

Issues

  • Missing posthog.identify() on login: The LoginComponent calls auth.login(username) and captures user_logged_in, but never calls posthog.identify(username) to associate the session with the user. All events remain anonymous with no way to build user-level funnels or retention charts. Should add posthog?.identify(username) after auth.login(username). [CRITICAL]
  • Missing posthog.reset() on logout: Two logout buttons exist (in ProfileComponent and LoginComponent) that call auth.logout() but never call posthog?.reset(). Subsequent users on the same device will inherit the previous user's identity, corrupting person data. [CRITICAL]
  • No reverse proxy: Client-side events go directly to the PostHog host, making them vulnerable to ad blockers. A Vite proxy or managed reverse proxy should be configured. [MEDIUM]
  • Missing defaults option in PostHogProvider: The docs recommend defaults: '2026-05-30' in all init calls. Without it, the SDK uses older default behaviors. [MEDIUM]

Other completed criteria

  • API key loaded from VITE_PUBLIC_POSTHOG_PROJECT_TOKEN environment variable
  • Host loaded from VITE_PUBLIC_POSTHOG_HOST environment variable
  • Graceful fallback when env vars are missing (renders without PostHogProvider)
  • Dev-mode validation errors for missing env vars
  • Logs configured with serviceName and environment

PostHog insights and events ⚠️

Filename PostHog events Description
src/main.tsx invoice_creation_submitted Captured when user submits the new invoice form
src/main.tsx invoice_update_submitted Captured when user submits an invoice edit
src/main.tsx user_logged_in Captured on demo login form submission
src/main.tsx user_logged_out Captured on logout button clicks (2 locations)
src/main.tsx captureException (auto) Enabled via capture_exceptions: true

Issues

  • Events lack enriched properties: All capture() calls are bare with no properties. For example, invoice_creation_submitted should include properties like { invoice_title: formData.get('title') }, and user_logged_in should include contextual info. This limits the ability to build meaningful breakdowns and filters. [MEDIUM]
  • Missing identify means events are not attributable: Without identify(), even well-named events cannot be tied to specific users, severely limiting analytics value for user-level insights. [CRITICAL]

Other completed criteria

  • Events represent real user actions (login, logout, invoice CRUD)
  • Event names are descriptive and use consistent snake_case convention
  • Events could enable product insights (login→invoice creation funnel) if identify was implemented
  • No PII in event properties
  • Log capture configured with appropriate service name and operation context

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