[CI] (6fb03e7) react-router/saas-template#1486
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
|
Now I have everything I need to evaluate the PR. PR Evaluation ReportSummaryThis PR integrates PostHog into a React Router v7 framework-mode SaaS template (pastebin app). It adds client-side initialization with
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors; SSR noExternal configured for posthog-js and @posthog/react |
| Preserves existing env vars & configs | Yes | Existing middleware, routes, and configs preserved; PostHog middleware appended to chain |
| No syntax or type errors | Yes | All TypeScript/JSX is valid |
| Correct imports/exports | Yes | posthog-js on client, posthog-node on server (.server.ts files) |
| Minimal, focused changes | No | Significant reformatting across pastes.tsx, dashboard.tsx, and pastes..tsx (attribute reordering, whitespace) |
| Pre-existing issues | None | No pre-existing issues noted |
Issues
- Unnecessary reformatting:
pastes.tsx,dashboard.tsx, andpastes..tsxcontain extensive attribute reordering and whitespace changes unrelated to PostHog. [LOW]
Other completed criteria
- Environment variables documented in
.envadded to.gitignore - Build configuration valid — SSR noExternal properly set for posthog packages
- Package.json is valid with all three PostHog packages added
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js, @posthog/react, and posthog-node all added to package.json |
| PostHog client initialized | Yes | Client init in entry.client.tsx with PostHogProvider; server middleware creates posthog-node per request with withContext() |
| capture() | Yes | 10 meaningful events across client and server |
| identify() | Yes | Called in sidebar layout with user email/name, though uses email as distinct_id |
| Error tracking | Yes | captureException(error) in root ErrorBoundary |
| Reverse proxy | No | Vite proxy configured at /ingest but api_host not updated to use it — events go directly to PostHog host |
Issues
- Reverse proxy misconfigured: The
vite.config.tssets up proxy routes at/ingest,/ingest/array, and/ingest/static, butentry.client.tsxsetsapi_hosttoimport.meta.env.VITE_PUBLIC_POSTHOG_HOSTinstead of"/ingest". The proxy is never used. Fix: setapi_host: "/ingest"inposthog.init(). [CRITICAL] - Identify uses email as distinct_id:
posthog.identify(navUserProps.user.email, ...)uses email as the distinct ID. Emails are mutable and not ideal identifiers. Use a stable database user ID instead. [MEDIUM] - No
posthog.reset()on logout: There is noposthog.reset()call when users log out, which means subsequent users on the same device will be associated with the previous user. [MEDIUM] defaultsoption present: Good — thedefaults: "2026-01-30"option is correctly set. [LOW - positive note]
Other completed criteria
- API key loaded from environment variable (
import.meta.env.VITE_PUBLIC_POSTHOG_PROJECT_TOKEN) - Host configured from environment variable
- Server middleware correctly uses
flushAt: 1andflushInterval: 0for short-lived requests __add_tracing_headersconfigured for client-server session correlationposthog.shutdown()called after each server request
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
login.tsx |
login_email_submitted |
Tracks login form submission — but includes email as PII in event properties |
register.tsx |
registration_email_submitted |
Tracks registration form submission — but includes email as PII in event properties |
auth.callback.ts |
user_signed_up |
Server-side: new user created after OAuth callback — includes email as PII |
contact-sales-team.tsx |
contact_sales_submitted |
Tracks sales contact form — includes work_email as PII |
user-account.tsx |
onboarding_user_account_completed |
Tracks user account onboarding step completion |
organization.tsx |
onboarding_organization_completed |
Tracks organization onboarding step with org name |
billing-action.server.ts |
subscription_cancelled, subscription_checkout_started, subscription_resumed, subscription_plan_switched |
Server-side billing events with org/subscription context |
_sidebar-layout.tsx |
identify() |
Identifies user with email and name on authenticated pages |
root.tsx |
captureException |
Captures unhandled errors in ErrorBoundary |
Issues
- PII in event properties:
login_email_submitted,registration_email_submitted,user_signed_up, andcontact_sales_submittedall include email addresses inposthog.capture()event properties. Email is PII and should only appear inidentify()person properties or/, not in event properties. Fix: removeemailfrom capture properties; it's already set viaidentify(). [CRITICAL]
Other completed criteria
- Events represent real user actions (signup, login, onboarding, billing lifecycle)
- Events enable product insights — a full signup-to-subscription funnel can be built
- Server-side billing events include enriched properties (org_id, subscription_id, price_lookup_key)
- Event names are descriptive and use consistent snake_case convention
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: scheduled
Trigger ID:
6fb03e7App:
react-router/saas-templateApp directory:
apps/react-router/saas-templateWorkbench branch:
wizard-ci-6fb03e7-react-router-saas-templateWizard branch:
mainContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-05-13T17:45:48.601Z
Duration: 677.0s