Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
thebushidocollective avatar

Sentry Sdk Configuration

  • 1 installs
  • 186 repo stars
  • Updated July 19, 2026
  • thebushidocollective/han

Initialize Sentry in applications, configure SDK options, and set up integrations across frameworks and platforms.

About

Covers initializing Sentry in applications, configuring SDK options, and setting up integrations across different frameworks and platforms. A developer uses it when adding and configuring the Sentry SDK.

  • SDK initialization and options
  • Framework and platform integrations

Sentry Sdk Configuration by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #489 of 596 Debugging skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/thebushidocollective/han --skill sentry-sdk-configuration

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars186
Last updatedJuly 19, 2026
Repositorythebushidocollective/han

What it does

Initialize Sentry in applications, configure SDK options, and set up integrations across frameworks and platforms.

Files

SKILL.mdMarkdownGitHub ↗

Sentry - SDK Configuration

Initialize and configure Sentry SDKs across different platforms and frameworks.

JavaScript/TypeScript

Browser SDK

import * as Sentry from "@sentry/browser";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  environment: process.env.NODE_ENV,
  release: process.env.RELEASE_VERSION,
  tracesSampleRate: 1.0,
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.replayIntegration(),
  ],
});

Node.js SDK

import * as Sentry from "@sentry/node";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  environment: process.env.NODE_ENV,
  release: process.env.RELEASE_VERSION,
  tracesSampleRate: 1.0,
  integrations: [
    Sentry.httpIntegration(),
    Sentry.expressIntegration(),
  ],
});

Next.js SDK

// sentry.client.config.ts
import * as Sentry from "@sentry/nextjs";

Sentry.init({
  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
  tracesSampleRate: 1.0,
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});
// sentry.server.config.ts
import * as Sentry from "@sentry/nextjs";

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  tracesSampleRate: 1.0,
});

React SDK

import * as Sentry from "@sentry/react";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.reactRouterV6BrowserTracingIntegration({
      useEffect,
      useLocation,
      useNavigationType,
      createRoutesFromChildren,
      matchRoutes,
    }),
  ],
  tracesSampleRate: 1.0,
});

// Wrap your app
const App = () => (
  <Sentry.ErrorBoundary fallback={<ErrorFallback />}>
    <YourApp />
  </Sentry.ErrorBoundary>
);

Python SDK

import sentry_sdk

sentry_sdk.init(
    dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
    environment=os.getenv("ENVIRONMENT"),
    release=os.getenv("RELEASE_VERSION"),
    traces_sample_rate=1.0,
    profiles_sample_rate=1.0,
)

Django Integration

# settings.py
import sentry_sdk

sentry_sdk.init(
    dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
    integrations=[
        sentry_sdk.integrations.django.DjangoIntegration(),
    ],
    traces_sample_rate=1.0,
    send_default_pii=True,
)

Go SDK

import "github.com/getsentry/sentry-go"

func main() {
    err := sentry.Init(sentry.ClientOptions{
        Dsn:              "https://examplePublicKey@o0.ingest.sentry.io/0",
        Environment:      os.Getenv("ENVIRONMENT"),
        Release:          os.Getenv("RELEASE_VERSION"),
        TracesSampleRate: 1.0,
    })
    if err != nil {
        log.Fatalf("sentry.Init: %s", err)
    }
    defer sentry.Flush(2 * time.Second)
}

Configuration Options

Sample Rates

Sentry.init({
  // Error sampling (1.0 = 100%)
  sampleRate: 1.0,

  // Transaction/trace sampling
  tracesSampleRate: 0.2,

  // Or use a sampler function
  tracesSampler: (samplingContext) => {
    if (samplingContext.name.includes("/health")) {
      return 0; // Don't trace health checks
    }
    return 0.2;
  },
});

Filtering Events

Sentry.init({
  beforeSend(event, hint) {
    // Filter out specific errors
    if (event.exception?.values?.[0]?.type === "NetworkError") {
      return null;
    }
    return event;
  },
  ignoreErrors: [
    "ResizeObserver loop limit exceeded",
    /^Script error\.?$/,
  ],
  denyUrls: [
    /extensions\//i,
    /^chrome:\/\//i,
  ],
});

Best Practices

1. Always set environment and release 2. Use environment variables for DSN 3. Configure appropriate sample rates for production 4. Filter noisy or irrelevant errors 5. Use framework-specific integrations 6. Initialize Sentry as early as possible

Related skills

Debuggingmonitoring

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.