Skip to content

feat(App): add Sentry for error reporting - #338

Merged
Advait1306 merged 1 commit into
developmentfrom
advait/eng-425
Jan 21, 2026
Merged

feat(App): add Sentry for error reporting#338
Advait1306 merged 1 commit into
developmentfrom
advait/eng-425

Conversation

@Advait1306

@Advait1306 Advait1306 commented Jan 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Integrate Sentry SDK (@sentry/react) for error tracking and logging
  • Configure Vite plugin (@sentry/vite-plugin) for automatic source map uploads
  • Initialize Sentry early in app lifecycle with sendDefaultPii and enableLogs enabled

Closes #337

Test plan

  • Verified error tracking works by triggering a test error
  • Confirm errors appear in Sentry dashboard with readable stack traces

🤖 Generated with Claude Code

Integrate Sentry SDK for error reporting with automatic source map uploads via Vite plugin.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@linear

linear Bot commented Jan 21, 2026

Copy link
Copy Markdown

@vercel

vercel Bot commented Jan 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
august-web Ready Ready Preview, Comment Jan 21, 2026 1:30pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
august-website Skipped Skipped Jan 21, 2026 1:30pm

Request Review

@greptile-apps

greptile-apps Bot commented Jan 21, 2026

Copy link
Copy Markdown

Confidence Score: 2/5

  • This PR has configuration issues that will prevent proper functionality
  • Score reflects two critical configuration problems: hardcoded DSN violates security best practices and breaks environment-based configuration, and missing auth token will cause source map uploads to fail silently. These prevent core Sentry features from working properly.
  • Pay close attention to apps/app/src/main.tsx (hardcoded DSN) and apps/app/vite.config.ts (missing auth configuration)

Important Files Changed

Filename Overview
apps/app/src/main.tsx Added Sentry initialization with hardcoded DSN (security issue) and PII enabled
apps/app/vite.config.ts Added Sentry Vite plugin with sourcemap support but missing authentication token configuration
apps/app/package.json Added Sentry dependencies - versions look appropriate

Sequence Diagram

sequenceDiagram
    participant App as Application Startup
    participant Sentry as Sentry SDK
    participant React as React Router
    participant User as User Interaction
    participant SentryIO as Sentry.io Server

    App->>Sentry: Initialize Sentry.init()
    Note over Sentry: DSN: hardcoded<br/>sendDefaultPii: true<br/>enableLogs: true
    Sentry->>SentryIO: Establish connection
    
    App->>React: Import routeTree
    App->>React: Create router instance
    App->>React: Render RouterProvider
    
    User->>React: Interact with application
    
    alt Error occurs
        React->>Sentry: Capture error automatically
        Sentry->>SentryIO: Send error + PII + logs
        Note over SentryIO: Store with source maps<br/>(if auth configured)
    end
    
    Note over App: Build Time
    participant Vite as Vite Build
    participant Plugin as Sentry Vite Plugin
    
    Vite->>Plugin: Build with sourcemap: true
    Plugin->>SentryIO: Upload source maps<br/>(requires auth token)
Loading

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment thread apps/app/src/main.tsx

// Initialize Sentry for error tracking
Sentry.init({
dsn: "https://9d87ba0a2f4279c02f059509b276419d@o4510748532342784.ingest.us.sentry.io/4510748533194752",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: hardcoded DSN should be moved to environment variable

Suggested change
dsn: "https://9d87ba0a2f4279c02f059509b276419d@o4510748532342784.ingest.us.sentry.io/4510748533194752",
dsn: import.meta.env.VITE_SENTRY_DSN,
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/app/src/main.tsx
Line: 9:9

Comment:
**logic:** hardcoded DSN should be moved to environment variable

```suggestion
  dsn: import.meta.env.VITE_SENTRY_DSN,
```

How can I resolve this? If you propose a fix, please make it concise.

Comment thread apps/app/src/main.tsx
// Initialize Sentry for error tracking
Sentry.init({
dsn: "https://9d87ba0a2f4279c02f059509b276419d@o4510748532342784.ingest.us.sentry.io/4510748533194752",
sendDefaultPii: true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: sendDefaultPii: true sends personally identifiable information (email, username, IP) to Sentry - ensure this complies with privacy policy

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/app/src/main.tsx
Line: 10:10

Comment:
**style:** `sendDefaultPii: true` sends personally identifiable information (email, username, IP) to Sentry - ensure this complies with privacy policy

How can I resolve this? If you propose a fix, please make it concise.

Comment thread apps/app/vite.config.ts
Comment on lines +19 to +22
}), sentryVitePlugin({
org: "sixhuman-es",
project: "web-app"
})],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: missing authentication configuration - source maps won't upload without auth token set via SENTRY_AUTH_TOKEN environment variable or in .env.sentry-build-plugin file

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/app/vite.config.ts
Line: 19:22

Comment:
**logic:** missing authentication configuration - source maps won't upload without auth token set via `SENTRY_AUTH_TOKEN` environment variable or in `.env.sentry-build-plugin` file

How can I resolve this? If you propose a fix, please make it concise.

@Advait1306
Advait1306 merged commit 51d2aef into development Jan 21, 2026
9 checks passed
@Advait1306
Advait1306 deleted the advait/eng-425 branch January 21, 2026 13:33
Advait1306 added a commit that referenced this pull request Jan 21, 2026
#339)

Integrate Sentry SDK for error reporting with automatic source map uploads via Vite plugin.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(App): add sentry for error reporting

1 participant