[CI] (6fb03e7) react-router/shopper#1485
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a React Router v7 framework-mode shopping app. It adds client-side initialization via
Confidence score: 5/5 🧙
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | All syntax is valid, dependencies added, SSR config correct |
| Preserves existing env vars & configs | Yes | Only PostHog additions; existing cart/routing logic preserved |
| No syntax or type errors | Yes | TypeScript types correct, optional chaining used throughout |
| Correct imports/exports | Yes | posthog-js for client, posthog-node for server, @posthog/react for hooks |
| Minimal, focused changes | Yes | All changes relate to PostHog integration; Link→button changes are necessary for event handlers |
| Pre-existing issues | None | Base app appears clean |
Issues
- Env vars not in .env.example: The
.envfile (not committed) contains the API key and host, but there's no.env.examplecommitted to document required variables for other developers. Only the setup report mentions them. [LOW]
Other completed criteria
- Build configuration is valid — vite.config.ts and react-router.config.ts changes are correct
- Dependencies properly added to package.json with appropriate version ranges
- SSR noExternal config prevents bundling issues with posthog-js in server context
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.373.4, @posthog/react@^1.9.0, posthog-node@^5.34.1 in package.json |
| PostHog client initialized | Yes | posthog.init() in entry.client.tsx with env vars, defaults: '2026-01-30', and tracing headers; server middleware creates PostHog Node client per request |
| capture() | Yes | 8 distinct capture calls across shopping flow |
| identify() | Yes | Called in checkout with email and name — but uses email as distinct_id |
| Error tracking | Yes | captureException(error) in ErrorBoundary via usePostHog() hook |
| Reverse proxy | No | No proxy configured in vite.config.ts or elsewhere; browser requests go directly to us.i.posthog.com |
Issues
- Email as distinct_id: In
checkout.tsx,posthog?.identify(formData.email, { email, name })uses the raw email address as the distinct ID. This is problematic: if a user types a different email, they become a new person in PostHog. Use a stable internal user/order ID instead. [MEDIUM] - No reverse proxy: Client-side PostHog requests go directly to
us.i.posthog.comand will be blocked by common ad blockers, losing event data. Configure a reverse proxy via Vite server proxy or React Router rewrites. [MEDIUM] - No posthog.reset() on logout: While this app may not have explicit logout, there's no
reset()call anywhere. If users share devices, sessions will bleed between users. [LOW]
Other completed criteria
- API key loaded from environment variable (
import.meta.env.VITE_PUBLIC_POSTHOG_PROJECT_TOKEN) — not hardcoded - API host correctly configured to
https://us.i.posthog.comvia env var - Server-side middleware correctly extracts tracing headers and uses
withContextpattern flushAt: 1andflushInterval: 0correctly set for server-side to ensure events are sent immediatelyshutdown()called after each request on server
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
app/routes/home.tsx |
start_shopping_clicked |
Top-of-funnel CTA tracking |
app/routes/products.tsx |
product_added_to_cart, product_searched, product_category_filtered |
Product discovery and add-to-cart from listing page; search fires per keystroke |
app/routes/products..tsx |
product_added_to_cart |
Add-to-cart from product detail page with quantity |
app/routes/cart.tsx |
cart_item_removed, cart_quantity_updated, checkout_started |
Cart management and checkout initiation with cart totals |
app/routes/checkout.tsx |
order_placed |
Order completion with total, subtotal, item count, and city |
app/root.tsx |
captureException |
Unhandled error tracking via ErrorBoundary |
Issues
- product_searched fires on every keystroke:
handleSearchcallsposthog?.capture('product_searched', { search_term: term })on every character typed. This creates excessive noise and costs. Debounce or capture on blur/submit instead. [MEDIUM] - City in order_placed event properties: The
cityfield inorder_placedproperties is borderline PII. While a city alone may not identify a person, it's worth considering whether this belongs in person properties via `` instead. [LOW]
Other completed criteria
- Events represent real user actions in an e-commerce flow (browsing → adding to cart → checkout → purchase)
- Events enable product insights — clear funnel from start_shopping_clicked → product_added_to_cart → checkout_started → order_placed
- Events include relevant enriched properties (product_id, product_name, category, price, quantity, cart totals)
- No PII in event properties (email/name only in identify call person properties, not in capture properties)
- 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/shopperApp directory:
apps/react-router/shopperWorkbench branch:
wizard-ci-6fb03e7-react-router-shopperWizard branch:
mainContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-05-13T17:40:17.552Z
Duration: 354.7s