Skip to main content

Sentry DSN Config Builder

Generate ready-to-use Sentry SDK initialization code for your framework. Paste your DSN, select React, Next.js, Vue, Node.js, Python, or Astro, configure sample rates and environment, and get copy-ready setup code instantly.

✓ React / Next.js / Vue ✓ Node.js / Python / Astro ✓ Sample rate config ✓ Session replay settings

Frequently Asked Questions

What is a Sentry DSN and where do I find it?▼

DSN (Data Source Name) is a connection string that tells your Sentry SDK where to send error events. It contains your project ID and public key. Find it in: Sentry Dashboard → Settings → Projects → [your project] → SDK Setup → Client Keys (DSN). The DSN is safe to include in client-side code — it only allows event ingestion, not data reading.

What sample rates should I use in production?▼

Error sampleRate: keep at 1.0 (100%) for production — you want to capture all errors. tracesSampleRate: start at 0.1 (10%) to limit performance overhead; increase for more data. replaysSessionSampleRate: 0.1 (10%) is typical for session replay — recording all sessions is expensive. replaysOnErrorSampleRate: keep at 1.0 to always capture replays when errors occur.

How does Sentry integrate with Next.js App Router?▼

Use the Sentry Next.js wizard: npx @sentry/wizard@latest -i nextjs. This creates three config files: sentry.client.config.ts (browser), sentry.server.config.ts (Node server), and sentry.edge.config.ts (Edge Runtime). The wizard also sets up source map uploading for readable stack traces. For App Router, Sentry automatically instruments Server Components and API routes.

What is the difference between sampleRate and tracesSampleRate?▼

sampleRate controls what fraction of error events are captured and sent to Sentry (default 1.0 = all errors). tracesSampleRate controls performance tracing — how many requests get traced with spans and transaction data for performance monitoring. Setting tracesSampleRate too high can add latency overhead. These are independent: you can capture 100% of errors while tracing only 5% of transactions.

How do I set up Sentry source maps for readable stack traces?▼

Source maps are essential for production error debugging. For Vite/Next.js, use @sentry/vite-plugin or the Next.js wizard to auto-upload during build. Set SENTRY_AUTH_TOKEN as an environment variable (found in: User Settings → Auth Tokens). The auth token allows Sentry to associate uploaded source maps with releases. Never commit auth tokens to git — use environment variables or CI secrets.

How do I filter out irrelevant errors in Sentry?▼

Use beforeSend callback: Sentry.init({ beforeSend(event, hint) { if (event.exception?.values?.[0]?.type === 'ChunkLoadError') return null; return event; } }). Filter by URL with allowUrls/denyUrls to ignore CDN errors. Use ignoreErrors array for specific error messages or regex patterns. Set environment to filter by environment in the Sentry dashboard. Use issue filters and alerts to route important errors to the right team.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →