Summary by TwinMind · 7m 42s

Summary by TwinMind · 7m 42s

Sentry Made The Component Nobody Wants To Make...

Sentry Made The Component Nobody Wants To Make...

Theo - t3․gg

Theo - t3․gg

Component Philosophy & Introduction

  • Hot take: some components not worth building yourself
  • Examples: date pickers, Intercom chat widgets
  • Time investment vs building in-house not justified
  • Sentry sponsored video about new user feedback component

User Feedback Component Concept

  • Example: Instagram app shake-to-report functionality
  • Captures bugs that don't throw errors automatically
  • Edge cases, broken links, UI issues hard to catch
  • Manual user reporting fills gap in error tracking

Sentry User Feedback Widget Overview

  • New widget makes user feedback collection easier
  • Complements traditional error catching
  • Simple "report a bug" button integration
  • Centralizes feedback with existing debugging workflow
  • Easy setup process demonstrated

Implementation Setup

  • Used existing Create T3 app tutorial project
  • Sentry already configured in project
  • Added feedback integration from Sentry changelog
  • Updated @sentry/nextjs package to 8.1.0
  • Added integration to client config (not server)
  • Fresh pnpm install required

Basic Functionality Demo

  • Report bug button appears automatically
  • Screenshot capture with cropping capability
  • User info collection (name, email)
  • Bug description text field
  • Automatic context capture
  • Sentry dashboard integration shows:
    • Screenshot
    • User replay functionality
    • Complete user journey tracking

Conditional Widget Display

  • Custom hook implementation for controlled appearance
  • Widget only shows when user signed in
  • autoInject: false configuration prevents default loading
  • Custom useFeedbackWidget hook created:
    • Takes shouldMount boolean parameter
    • Creates/destroys widget based on auth state
    • Handles widget cleanup on unmount

Technical Implementation Details

  • Root layout integration required
  • Must be placed in body tag to avoid breaking
  • SSR: false initially used but may not be necessary
  • Clerk authentication integration
  • Boolean conversion for auth state checking

Customization Options

  • Branding removal: showBranding: false
  • Theme customization: colorScheme: 'dark'
  • Custom theming for light/dark modes
  • Specific element targeting available
  • Color scheme enforcement over system theme
  • Easy brand alignment with minimal config changes

Technical Notes

  • Type safety not fully implemented yet
  • Hook pattern useful for third-party integrations
  • Common pattern for external widget management
  • Future Sentry SDK may include built-in hook