Sentry
Sentry is used for error reporting and performance monitoring across web + mobile (Capacitor).
Where Sentry is initialized
client/src/index.js
Key points from the setup:
- DSN is selected based on platform/environment (separate dev/prod DSNs)
releasecomes fromREACT_APP_RELEASE_VERSIONorSENTRY_RELEASEenvironmentis set toproductionordevelopment- tags include:
platform:ios/android/webruntime:capacitor-webvieworbrowserchannel:store/debug/web
Releases and sourcemaps
Runtime reporting is always on via Sentry.init in client/src/index.js.
For readable stack traces in Sentry, a release must exist and sourcemaps must be uploaded for that same release value (SENTRY_RELEASE / REACT_APP_RELEASE_VERSION).
- CLI config:
client/sentry.properties(orgfoodfight, usesSENTRY_AUTH_TOKEN) - iOS CI: the
ios_deploymentworkflow creates a Sentry release and uploads./build/static/jssourcemaps afternpm run build
Local/manual (after npm run build in client/):
export VERSION=$(sentry-cli releases propose-version)
sentry-cli releases new "$VERSION" --org foodfight --project <your-project>
sentry-cli releases set-commits "$VERSION" --auto --org foodfight --project <your-project>
sentry-cli sourcemaps upload --release="$VERSION" --org foodfight --project <your-project> ./build/static/js
sentry-cli releases finalize "$VERSION" --org foodfight --project <your-project>
Use the Sentry project that matches the environment you care about (for example prod-environment vs javascript-react in sentry.properties).
Sentry webpack plugin (optional)
There is a Sentry webpack plugin config file:
client/sentry.config.js
App-level tracking helpers
Some features emit “tracking messages” to Sentry for alerting/debugging:
- Payments:
client/src/utils/sentryPaymentTracker.js - Live bets:
client/src/utils/sentryLiveBetsTracker.js
Quick checks
- If stack traces are minified in Sentry:
- verify the event’s
releasematches the release you uploaded sourcemaps for - verify sourcemaps exist for
./build/static/jsfor that release
- verify the event’s
- If you see events in the wrong environment:
- check
client/src/index.jsenv selection logic (native vs web)
- check