[CI] (1776c51) react-native/react-native-saas#2733
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
|
Now I have enough context from the diff and the key files to produce the evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog into a React Native SaaS app using
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors, all imports resolve, native gradle config is correct |
| Preserves existing env vars & configs | Yes | Existing app code and configs preserved; PostHog additions are additive |
| No syntax or type errors | Yes | All JS files are syntactically valid |
| Correct imports/exports | Yes | posthog-react-native, react-native-config imports are correct for React Native |
| Minimal, focused changes | Yes | All changes relate to PostHog integration; testID additions support autocapture |
| Pre-existing issues | None | No pre-existing issues observed |
Issues
- No
.env.examplecommitted: The.envfile with the real API key exists on disk but is (correctly) not committed. However, no.env.exampleor equivalent is committed either, leavingPOSTHOG_PROJECT_TOKENandPOSTHOG_HOSTundocumented for collaborators. [MEDIUM]
Other completed criteria
- Build configuration is valid —
build.gradlecorrectly applies the dotenv gradle plugin package.jsondependencies are correctly specified with appropriate version rangesjsconfig.jsonandreact-native-config.d.tsproperly configured
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-react-native@^4.55.0 added with required peers (react-native-device-info, react-native-localize, react-native-svg) |
| PostHog client initialized | Yes | new PostHog(token, config) in posthog.js; PostHogProvider wraps the navigation stack in routes.js with autocapture config |
| capture() | Yes | 15+ meaningful posthog.capture() calls across auth, teams, projects, and members flows |
| identify() | No | Uses raw email address as distinct_id via getDistinctIdFromEmail(), which causes fragmented person data. Should use a stable user ID from the backend. |
| Error tracking | Yes | posthog.captureException() used in captureError() wrapper; called in all catch blocks across sagas |
| Reverse proxy | N/A | Mobile app — reverse proxy is not applicable |
Issues
- Email as distinct_id:
getDistinctIdFromEmail()normalizes the email and returns it as thedistinct_idforposthog.identify(). PostHog best practices require a stable, unique user ID (e.g., database user ID or UUID) as the distinct_id. Using email addresses leads to fragmented analytics if a user changes their email, and is explicitly an anti-pattern. The fix: use the user's database ID from the auth response (e.g.,response.data.user.id) as the distinct_id, and pass the email only as a person property via ``. [CRITICAL]
Other completed criteria
- API key loaded from environment variable via
react-native-config(not hardcoded) - Host correctly configured with fallback to
https://us.i.posthog.com PostHogProvidercorrectly wraps navigation stack with autocapture config for touches- Manual screen tracking correctly implemented via
NavigationContaineronStateChangecallback posthog.reset()called on sign-out to unlink future eventscaptureAppLifecycleEvents: trueenabled for automatic lifecycle tracking
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
src/pages/SignIn/index.js |
sign_in_submitted |
Captures sign-in form submission with email domain and password presence |
src/store/modules/auth/sagas.js |
sign_in_succeeded, sign_in_failed, signed_out, captureException |
Full auth lifecycle with method, domain, and team context |
src/components/TeamSwitcher/index.js |
team_selected |
Team selection with team_id, slug, and name length |
src/pages/Main/index.js |
team_switcher_opened, members_drawer_opened |
UI interaction events with active team context |
src/store/modules/teams/sagas.js |
team_created, team_creation_failed, captureException |
Team creation lifecycle with source and team metadata |
src/store/modules/projects/sagas.js |
project_created, project_creation_failed, captureException |
Project creation with source, ID, and title length |
src/store/modules/members/sagas.js |
member_invited, member_invitation_failed, member_role_updated, member_role_update_failed, captureException |
Member management with invitation channel, role counts, and team context |
src/routes.js |
`` (via posthog.screen()) |
Manual screen view tracking on navigation state changes |
Issues
- Email used as fabricated distinct_id: The
identifySignedInUserfunction uses the user's email address as thedistinct_id. This is PII used as a fabricated distinct_id, which violates PostHog best practices and creates data quality issues. [CRITICAL]
Other completed criteria
- Events represent real user actions (sign-in, team switching, project creation, member invites)
- Events enable product insights — sign-in funnel, team/project creation trends, member management flows
- Events include rich contextual properties (team_slug, creation_source, auth_method, email_domain)
- Event names follow consistent
snake_caseconvention with descriptive action names - Email domain extraction (
sanitizeEmailDomain) correctly strips PII from event properties - Success/failure event pairs enable conversion analysis
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: wizard-pr
Trigger ID:
1776c51App:
react-native/react-native-saasApp directory:
apps/react-native/react-native-saasWorkbench branch:
wizard-ci-1776c51-react-native-react-native-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-10T23:40:32.964Z
Duration: 349.5s
YARA Scanner