[CI] (cef44b4) tanstack-router/tanstack-router-code-based-saas#1412
Closed
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
Closed
[CI] (cef44b4) tanstack-router/tanstack-router-code-based-saas#1412wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a TanStack Router (code-based) React SaaS app. It adds
Confidence score: 5/5 🧙
File changes
App sanity check ✅
IssuesNo critical or medium issues.
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.372.6 and @posthog/react@^1.9.0 added to package.json |
| PostHog client initialized | Yes | PostHogProvider wrapping RootComponent with apiKey from env, api_host: '/ingest', defaults: '2026-01-30', capture_exceptions: true |
| capture() | Yes | 7 custom events across login, logout, invoice CRUD, and plan upgrade flows |
| identify() | Yes | Called on login with username as distinct_id; posthog.reset() called on logout |
| Error tracking | Yes | capture_exceptions: true in init config + manual posthog.captureException(err) in mutation error handlers |
| Reverse proxy | Yes | Vite dev proxy configured: /ingest/static/* and /ingest/array/* → us-assets.i.posthog.com; /ingest/* → PostHog host |
Issues
- Username as distinct_id:
posthog.identify(username, { username })uses the raw form input as the distinct_id. While functional if usernames are unique, a database user ID is preferable for stability. Usernames may change or collide. [MEDIUM]
Other completed criteria
- API key loaded from
VITE_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable - Host correctly routed through
/ingestreverse proxy withui_hostfallback tohttps://us.posthog.com - Reverse proxy routes both
/ingest/static/*and/ingest/array/*to assets origin per documentation requirements posthog.reset()correctly called beforeauth.logout()on both logout pathsdebug: import.meta.env.DEVenables debug logging only in development
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
src/main.tsx |
user_signed_in |
Captured on login form submit with { username } |
src/main.tsx |
user_signed_out |
Captured on logout from both profile and login pages, followed by posthog.reset() |
src/main.tsx |
invoice_created |
Captured on successful invoice creation with { invoice_id, title } |
src/main.tsx |
invoice_create_failed, captureException |
Captured on invoice creation failure with { title }, plus exception capture |
src/main.tsx |
invoice_updated |
Captured on successful invoice update with { invoice_id, title } |
src/main.tsx |
invoice_update_failed, captureException |
Captured on invoice update failure with { invoice_id }, plus exception capture |
src/main.tsx |
plan_upgrade_clicked |
Captured on upgrade button click with { current_plan: 'free' } |
Issues
usernamein event properties: Theuser_signed_inevent includes{ username }as an event property. Since this is user-identifying information and is already set viaidentify(), it should be removed from the capture properties to keep PII out of event data. [LOW]
Other completed criteria
- Events represent real user actions mapping to actual product flows (authentication, invoice management, plan conversion)
- Events enable product insights: sign-in → invoice funnel, success/failure rates, churn signals
- Events include enriched properties (invoice_id, title, current_plan)
- Consistent snake_case naming convention across all events
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: context-mill-pr
Trigger ID:
cef44b4App:
tanstack-router/tanstack-router-code-based-saasApp directory:
apps/tanstack-router/tanstack-router-code-based-saasWorkbench branch:
wizard-ci-cef44b4-tanstack-router-tanstack-router-code-based-saasWizard branch:
mainContext Mill branch:
basic-skills-v2PostHog (MCP) branch:
masterTimestamp: 2026-05-01T21:18:47.953Z
Duration: 414.1s