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)
  • release comes from REACT_APP_RELEASE_VERSION or SENTRY_RELEASE
  • environment is set to production or development
  • tags include:
    • platform: ios / android / web
    • runtime: capacitor-webview or browser
    • channel: 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 (org foodfight, uses SENTRY_AUTH_TOKEN)
  • iOS CI: the ios_deployment workflow creates a Sentry release and uploads ./build/static/js sourcemaps after npm 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 release matches the release you uploaded sourcemaps for
    • verify sourcemaps exist for ./build/static/js for that release
  • If you see events in the wrong environment:
    • check client/src/index.js env selection logic (native vs web)