sentry-react-sdk
Audited by Runlayer on Mar 2, 2026
Malicious tool definition detected
Return `null` to discard: ```typescript Sentry.init({ dsn: import.meta.env.VITE_SENTRY_DSN, enableLogs: true, beforeSendLog: (log) => { // Drop debug and trace logs in production if (log.level === "debug" || log.level === "trace") { return null; } // Scrub sensitive attribute keys if (log.attributes?.password) { delete log.attributes.password; } if (log.attributes?.["credit_card"]) { log.attributes["credit_card"] = "[REDACTED]"; } // Drop noisy health-check logs by message content if (log.messag
Tool passed security scan
Malicious tool definition detected
Error occurs in production → stack frame contains the Debug ID 4. Sentry uses the Debug ID to locate the exact source map → deobfuscates the trace Debug IDs are more reliable than release-based matching (older approach) because they don't depend on consistent release naming or artifact upload timing.
}) sentryVitePlugin({ reactComponentAnnotation: { enabled: true, ignoredComponents: [] } }) // Babel plugin direct: @sentry/babel-plugin-component-annotate // ── Source Maps ─────────────────────────────────────────────── npx @sentry/wizard@latest -i sourcemaps // automated setup // Vite: build.sourcemap = "hidden" + sentryVitePlugin() // Webpack: devtool: "hidden-source-map" + sentryWebpackPlugin() // CRA: use CRACO + sentryWebpackPlugin // Manual: npx sentry-cli sourcemaps upload --auth-token
Tool passed security scan
Malicious tool definition detected
Malicious tool definition detected
SENTRY_ORG=my-org-slug SENTRY_PROJECT=my-project-slug ``` **Create React App (via CRACO):** ```bash npm install @craco/craco @sentry/webpack-plugin --save-dev ``` ```javascript // craco.config.js const { sentryWebpackPlugin } = require("@sentry/webpack-plugin"); module.exports = { webpack: { plugins: { add: [ sentryWebpackPlugin({ org: process.env.SENTRY_ORG, project: process.env.SENTRY_PROJECT, authToken: process.env.SENTRY_AUTH_TOKEN, }), ], }, }, }; ``` ### For Each Agreed Feature Walk throug
Malicious tool definition detected
Tool passed security scan
Malicious tool definition detected
### Manual Session Control When both sample rates are `0`, control recording programmatically: ```typescript Sentry.init({ dsn: "...", replaysSessionSampleRate: 0, replaysOnErrorSampleRate: 0, integrations: [Sentry.replayIntegration()], }); const replay = Sentry.getReplay(); // Start continuous recording: replay.start(); // Start in buffer mode (hold in memory, send on flush): replay.startBuffering(); // Stop recording and flush all pending data: await replay.stop(); // Upload buffered data with
Tool passed security scan
Malicious tool definition detected