Why Sentry?
Sentry captures errors with full stack traces, source maps, breadcrumbs, and context — so you fix bugs before users complain.
Quick Start
npm install @sentry/node
import * as Sentry from '@sentry/node'
Sentry.init({ dsn: 'https://your-dsn@sentry.io/123', tracesSampleRate: 0.1 })
// Errors are captured automatically
try {
riskyOperation()
} catch (error) {
Sentry.captureException(error)
}
React
import * as Sentry from '@sentry/react'
Sentry.init({ dsn: 'https://your-dsn@sentry.io/123' })
function App() {
return (
<Sentry.ErrorBoundary fallback={<p>Something went wrong</p>}>
<MyApp />
</Sentry.ErrorBoundary>
)
}
Performance Monitoring
const transaction = Sentry.startTransaction({ name: 'process-order' })
const span = transaction.startChild({ op: 'db.query' })
await db.query('SELECT * FROM orders')
span.finish()
transaction.finish()
Breadcrumbs (What Happened Before the Error)
Sentry auto-captures:
- Console logs
- HTTP requests
- UI clicks
- Navigation
- State changes
Source Maps
npx @sentry/wizard@latest -i sourcemaps
npm run build # Uploads source maps automatically
Sentry shows the ORIGINAL TypeScript code in error reports, not minified JS.
Need to extract data from any website at scale? I build custom web scrapers — 77 production scrapers running on Apify Store. Email me at spinov001@gmail.com for a tailored solution.
Top comments (0)