You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added Bugmail integration as a simpler alternative to PostHog for error tracking.
Bugmail uses a Gmail-style inbox approach - ideal for developers who want straightforward bug reports without complex configuration. NO config hell, no bloated dashboards, just get emailed when stuff breaks in production (30 seconds setup).
Changes:
Added optional Bugmail SDK setup
Configured via NEXT_PUBLIC_BUGMAIL_API_KEY and NEXT_PUBLIC_BUGMAIL_PROJECT_ID environment variable
Updated README with setup instructions
Zero impact if not configured (existing postHog setup unchanged)
PR Type
Enhancement
Description
Added BugMail integration for simple email-based error tracking
Implemented SafeBugMailProvider wrapper for optional, zero-config setup
Created error boundary component to capture and report exceptions
Updated documentation with BugMail setup instructions and environment variables
Diagram Walkthrough
flowchart LR
A["Environment Variables"] -->|"API Key & Project ID"| B["SafeBugMailProvider"]
B -->|"Conditional Wrapping"| C["Root Layout"]
C --> D["Error Boundary"]
D -->|"captureException"| E["BugMail Service"]
F["Documentation"] -->|"Setup Guide"| E
Below is a summary of compliance checks for this PR:
Security Compliance
⚪
Hard-coded external endpoint
Description: The BugMail provider is configured with a hard-coded API endpoint ('https://api.bugmail.site'); if this library sends sensitive error details (stack traces, user context) from the client, forcing a fixed external endpoint reduces control over egress and CSP pinning and may violate data residency/compliance—make the endpoint configurable via environment variable and document data sent. bugmail-provider.tsx [16-20]
Description: Client-side error handler captures exceptions and logs the full error to console in production, which can leak stack traces and potentially sensitive details to end users and browser logs; gate console logging behind a development check or strip messages in production. error.tsx [15-22]
Referred Code
useEffect(()=>{// Only report if BugMail is configured (provider will handle the check)if(bugmail){bugmail.captureException(error);}// Fallback: Log to consoleconsole.error(error);},[error,bugmail]);
Ticket Compliance
⚪
🎫 No ticket provided
Create ticket/issue
Codebase Duplication Compliance
⚪
Codebase context is not defined
Follow the guide to enable codebase context checks.
Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code self-documenting
Objective: To create a detailed and reliable record of critical system actions for security analysis and compliance.
Status: Missing audit logs: The new error handling reports exceptions to BugMail but does not add or reference any audit trail for critical actions, which may be acceptable if out of scope but is not verifiable from this diff.
Referred Code
useEffect(()=>{// Only report if BugMail is configured (provider will handle the check)if(bugmail){bugmail.captureException(error);}// Fallback: Log to consoleconsole.error(error);},[error,bugmail]);
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful degradation
Status: Limited context: Errors are captured and logged, but no additional actionable context (user/session, route, custom metadata) is attached to the BugMail report, which may limit debugging effectiveness.
Referred Code
useEffect(()=>{// Only report if BugMail is configured (provider will handle the check)if(bugmail){bugmail.captureException(error);}
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive information like PII, PHI, or cardholder data.
Status: Console logging: The fallback console.error may log full Error objects including stack traces that could contain sensitive details if executed in production.
Referred Code
// Fallback: Log to consoleconsole.error(error);},[error,bugmail]);
✅ Prevent duplicate error loggingSuggestion Impact:The commit moved the console.error(error) call into an else block so it only runs when bugmail is falsy, eliminating redundant logging when BugMail captures the exception.
code diff:
if (bugmail) {
bugmail.captureException(error);
+ } else {+ // Fallback: Log to console if BugMail is not configured+ console.error(error);
}
- // Fallback: Log to console- console.error(error);
To prevent redundant error logging, move console.error(error) into an else block so it only executes as a fallback when BugMail is not configured.
if (bugmail) {
bugmail.captureException(error);
+} else {+ // Fallback: Log to console if BugMail is not configured+ console.error(error);
}
-// Fallback: Log to console-console.error(error);
[Suggestion processed]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies a logical flaw where errors are always logged to the console, creating redundancy, and proposes a fix that aligns the code with its documented intent to use console.error as a fallback.
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
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.
User description
Added Bugmail integration as a simpler alternative to PostHog for error tracking.
Bugmail uses a Gmail-style inbox approach - ideal for developers who want straightforward bug reports without complex configuration. NO config hell, no bloated dashboards, just get emailed when stuff breaks in production (30 seconds setup).
Changes:
Added optional Bugmail SDK setup
Configured via NEXT_PUBLIC_BUGMAIL_API_KEY and NEXT_PUBLIC_BUGMAIL_PROJECT_ID environment variable
Updated README with setup instructions
Zero impact if not configured (existing postHog setup unchanged)
PR Type
Enhancement
Description
Added BugMail integration for simple email-based error tracking
Implemented SafeBugMailProvider wrapper for optional, zero-config setup
Created error boundary component to capture and report exceptions
Updated documentation with BugMail setup instructions and environment variables
Diagram Walkthrough
File Walkthrough
.env.example
Add BugMail environment variables.env.example
README.md
Document BugMail setup and featuresREADME.md
error.tsx
Create error boundary with BugMail integrationapp/error.tsx
layout.tsx
Wrap layout with BugMail providerapp/layout.tsx
bugmail-provider.tsx
Implement conditional BugMail provider wrappercomponents/bugmail-provider.tsx
package.json
Add BugMail JavaScript SDK dependencypackage.json