Skip to content
Back to skills

Sentry Knowledge Patch

ASecurity

Sentry JavaScript SDK

  • 25 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
developmentjavascriptgojavavuenextjsnodenodejsawsapidatabase

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill sentry-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sentry Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sentry Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-sentry-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-sentry-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sentry-knowledge-patch
description: Sentry JavaScript SDK
version: "10.68.0"
license: MIT
metadata:
  author: Nevaberry
---


# Sentry JavaScript SDK

Load this skill when migrating SDK APIs, configuring telemetry collection,
working with streamed spans or structured logs, or integrating framework builds
and server runtimes. Use the topic references for API details and examples.

## Reference index

| Reference | Topics |
| --- | --- |
| [Migrations and runtime](references/migrations-and-runtime.md) | Core imports, runtime and dependency compatibility, module loading, scopes, clients, sessions |
| [Tracing and spans](references/tracing-and-spans.md) | Sampling, propagation, streaming, HTTP and database spans, browser tracing, AI and MCP instrumentation |
| [Logging, privacy, and events](references/logging-privacy-and-events.md) | Data collection, error processing, logs, feedback, Replay, metrics and configuration reports |
| [Frameworks and builds](references/frameworks-and-builds.md) | Source maps, bundlers, tunnels, framework migrations, Cloudflare, Lambda, NestJS and cron monitoring |
| [Modern server frameworks](references/modern-server-frameworks.md) | Fastify, Elysia, Hono, Nitro, TanStack Start and Effect setup and instrumentation |

## Breaking changes and deprecations

### Core exports and initialization

Use the `Client` class; migrate removed `BaseClient` imports and subclasses to it.
Move retained `@sentry/utils` and `@sentry/types` imports to `@sentry/core`.
Replace `hasTracingEnabled()` with `hasSpansEnabled()`, the core `logger` export
with `debug`, and the `Logger` type with `SentryDebugLogger`.
`recordDroppedEvent` takes the reason and data category, without an event object.

From 11.5.0, `Sentry.init()` warns when a client is already active and replaces it
without closing it. Call `await Sentry.close()` before reinitializing to unbind
the old client. Framework-specific client reuse is described in the runtime reference.
From 11.17.0, `@sentry/core` removes `getActiveClient` and publicly exports
`isClientClosed` and `warnIfClientIsActive`.

### Sampling, scopes, and sessions

Read `name` and `attributes` directly in `tracesSampler`; `transactionContext`
was removed. The context includes `normalizedRequest` and `parentSampleRate`.
In `profilesSampler`, replace `request` with `normalizedRequest` and use
top-level fields such as `name`. `tracesSampleRate: undefined` behaves like an
omitted option, allowing downstream SDKs to decide sampling.

The propagation context no longer carries `spanId`; read the active span ID
with `Sentry.getActiveSpan()?.spanContext().spanId`. Custom propagation contexts
require `sampleRand` and optionally accept `propagationSpanId`.
APIs typed with `Scope` require a `Scope` instance. `startSpan` clones supplied
scopes; set tags directly on the supplied scope to keep them after the callback.
Session tracking reads the isolation scope, ignoring sessions only on local scopes.
Replace `autoSessionTracking` with integration settings.

### Logs, Replay, and browser measurements

Move `enableLogs` and `beforeSendLog` out of `_experiments` to top-level options.
Feedback flushes Replay by default; remove `_experiments.autoFlushOnFeedback`.
The browser SDK stops collecting FID. Migrate dependent event processing, alerts,
and dashboards to INP; FID alerts can trigger because values are missing.

### Dependency and build migrations

SDK v10's Node.js SDKs use OpenTelemetry `2.x.x` and `0.20x.x`. Applications that
cannot move to OpenTelemetry v2 can stay on SDK v9 or use `@sentry/node-core`,
which has wider OpenTelemetry peer ranges. From 10.77.1, use OpenTelemetry
SDK v2 and `@opentelemetry/api` below 1.10.0 with SDK v10; use SDK v11 for
OpenTelemetry SDK v3 and API 1.10.0.

From 11.8.0, standalone bundler plugins follow the SDK version and require
Node.js 20.19.0 or later. The webpack plugin requires webpack 5.1 or later.
Those plugins support self-hosted server versions 26.4.2 or later.
Next.js no longer derives release names from its build ID; set the release
explicitly when that ID is your deployment's release identifier.

### Framework and instrumentation migrations

Import `nestIntegration` from `@sentry/nestjs`; the framework reference lists
the removed NestJS handlers, decorators, services, interceptors, and filters.
Remove `logErrors` from `vueIntegration()`. Vue uses a configured error handler
and rethrows otherwise. Pinia `stateTransformer` receives state keyed by store ID.
Remove `autoInstrumentRemix`; the SDK enables that instrumentation automatically.
The Cloudflare SDK deprecates `cacheClient` in 11.14.0.

From 11.18.0, `@sentry/effect` replaces `effectLayer`, `SentryEffectTracer`,
`SentryEffectLogger`, `SentryEffectMetricsLayer`, and `SentryEffectExternalSpanLayer`
with `layer`, `layerTracer`, `layerLogger`, `layerMetrics`, and `layerExternalSpan`.
Provide the tracing and logging layers directly in Effect v3 or v4.
The logging layer preserves existing loggers, including console output.

Update span-origin filters for the renamed HTTP, database, queue, AI, MCP,
Firebase, AWS, and browser vital origins in the tracing reference.

## Streamed spans

With tracing configured, SDK 10.x from 10.66.0 supports server and serverless
opt-in with `traceLifecycle: "stream"`, or browser opt-in with
`Sentry.spanStreamingIntegration()`. Stream mode is the default from 11.0.0;
Cordova and Electron are excluded. It sends finished spans in batches and allows
traces with more than 1,000 spans. Stream and transaction SDKs can share a trace.

Wrap `beforeSendSpan` with `Sentry.withStreamedSpan()` to apply it at flush time;
an unwrapped hook forces transaction mode. `StreamedSpanJSON` uses `name`, raw
`attributes`, `end_timestamp`, and `attributes["sentry.op"]` in place of
`description`, processed `data`, `timestamp`, and `op`. Status is `"ok"` or `"error"`.

Move `beforeSendTransaction` drop rules to `ignoreSpans`. Rules match initial
names and attributes. A service-span match drops descendants; a child-span match
drops that span and reparents children to the nearest retained ancestor.
Use `debug: true` during development to find initial auto-instrumented span names.

Flushes run every five seconds by default, at 1,000 buffered spans in a trace,
or at the batch size limit. `Sentry.flush()` and `Sentry.close()` flush explicitly.
Check browser DevTools for `application/vnd.sentry.items.span.v2+json` envelopes.
Use `Sentry.setAttribute()` and `Sentry.setAttributes()` for shared span, log,
and metric metadata; keep tags for error events. Global-scope attributes apply
app-wide; current-scope attributes are local to an operation.

## Collection, error processing, and structured logs

The browser SDK collects user identity data, HTTP bodies, and URL query
parameters by default, replacing built-in denylisted values such as `auth` and
`password` with `[Filtered]`. Set `dataCollection.userInfo` to `false` to disable
user identity collection. Set `dataCollection: { httpBodies: [] }` to disable
body collection; TanStack Start needs it in both client and server initializers.

`dataCollection.urlQueryParams` governs collected URL queries. From 11.17.0 it
also filters `key=value` pairs in fragments and drops parameter-bearing fragments
when false, while preserving plain anchors and hash route paths. The privacy
reference details the affected URL fields, spans, breadcrumbs, and headers.

`requestDataIntegration` no longer populates the event user. Set it explicitly;
the integration uses `sendDefaultPii` as a fallback only for IP collection.
`beforeSend` runs before error `sampleRate`, and session updates still occur
when sampling drops an error. Console exceptions are handled by default;
with `attachStackTrace: true`, use `captureConsoleIntegration({ handled: false })`
to keep captured console messages unhandled.

From 11.2.0, Node.js and Bun send only the first of two consecutive captures
of the same error. Remove the default `Dedupe` integration to send both.

Enable logs with top-level `enableLogs`. Use `Sentry.logger.fmt` as a tagged
template for searchable interpolated parameters. Configure console methods
through `consoleLoggingIntegration`'s `levels`; additional arguments become
`message.parameter.0`, `message.parameter.1`, and similar searchable attributes.
`Sentry.createConsolaReporter()` is available from 10.12.0.

Shared log and metric attributes support strings, numbers, booleans, and arrays
of those values. Logs during active spans include `sentry.trace.parent_span_id`;
logs during an active replay include `sentry.replay_id` on platforms with Session Replay.

## Builds, tunnels, and framework startup

Astro, Gatsby, Next.js, SolidStart, and SvelteKit preserve explicit source-map
settings. Maps enabled by the SDK are deleted after upload; explicitly enabled
maps are kept. Use the framework
reference for version-specific `sourcemaps.upload`, `sourcemaps.injectDebugIds`,
`sourcemaps.delete`, and `filesToDeleteAfterUpload` controls.

From 11.10.0, browser `tunnel: true` derives a same-origin path from the DSN;
the supported frameworks serve it when the server enables
`Sentry.serveTunnelIntegration()`. From 11.12.0, the integration intercepts
managed tunnel requests before app routing on Node.js, Bun, Deno, Cloudflare
Workers, and AWS Lambda. Use `{ intercept: false }` and
`handleTunnelRequestIfMatched` for manual routing.

The Cloudflare Vite plugin instruments the Worker entry and exported Durable
Objects, WorkerEntrypoints, Workflows, and Agents. `wranglerConfigPath` selects
the Wrangler config. Instrumented Durable Object methods fork isolation scopes
per call; constructors have their own isolation scope from 11.3.0.

Initialize the alpha Elysia SDK before creating the app and wrap it before
registering routes. For Hono, use the matching runtime entry and peer SDK;
Node.js uses a preloaded initializer, while Bun, Deno, and Workers register
the SDK middleware before routes. Set the Wrangler `nodejs_compat` flag to
enable `AsyncLocalStorage`.

The beta Nitro SDK uses `withSentryConfig()` and a preloaded root `instrument.mjs`.
For TanStack Start, import the client initializer first in `src/client.tsx`,
put `sentryTanstackStart` last
in the Vite plugin list, wrap the server handler, and place SDK middleware first
in each `createStart()` middleware array. Report SSR rendering exceptions
separately with `captureException()`. Startup-flag fallbacks and their
instrumentation limits are in the modern server reference.

## Browser, AI, MCP, and cron instrumentation

From 11.14.0, `browserTracingCoreIntegration()` supplies pageload and navigation
spans. Add fetch, XHR, linked traces, long tasks, and resources individually with
the integrations listed in the tracing reference; CDN bundles also export them.

MCP server instrumentation instruments newly created `McpServer` instances
automatically. Per-server wrappers can override recording. MCP trace metadata
in `params._meta` supports stdio; `propagateTraceparent: true` also accepts W3C
`traceparent`. Missing, invalid, or cross-org metadata keeps the MCP span in the
transport trace. The tracing reference covers AI tool, decision, extraction,
conversation, content-recording, and per-call hook behavior by integration.

Cron monitoring is opt-in. Cloudflare `cronTriggersIntegration()` uses trigger
schedules; NestJS `monitorCronJobs` monitors `@Cron()` methods and creates billed
monitors. Node cron integrations replace the corresponding legacy wrappers.
The framework reference includes exclusions, slug selection, and schedule limits.

Files in this skill

  • SKILL.md7.7 KB
  • coverage.json1.1 KB
  • references/frameworks-and-builds.md5.9 KB
  • references/logging-privacy-and-events.md4.4 KB
  • references/migrations-and-runtime.md5 KB
  • references/modern-server-frameworks.md4.5 KB
  • references/tracing-and-spans.md4.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.