sentry-browser-sdk
Full Sentry SDK setup for browser JavaScript. Use when asked to "add Sentry to a website", "install @sentry/browser", or configure error monitoring, tracing, session replay, or logging for vanilla JavaScript, jQuery, static sites, or WordPress.
Security Assessment
Detected risks:
About sentry-browser-sdk
A guided setup skill for installing and configuring the `@sentry/browser` SDK (version 10.0.0 or later) in browser JavaScript projects that have no framework-specific SDK—vanilla JS, jQuery, static sites, and CMS platforms such as WordPress, Shopify, and Squarespace. It acts as an opinionated wizard that scans the project and walks through complete setup of error monitoring, tracing, session replay, and logging. It is invoked when a user asks to add Sentry to a website, install `@sentry/browser`, or configure monitoring without a framework.
Setup proceeds in phases. Phase 1 (Detect) checks first for frameworks—React, Next.js, Vue, Angular, Svelte/SvelteKit, Remix, Nuxt, Astro, Ember, and Node server frameworks like Express, Fastify, and NestJS—because framework SDKs add router-aware transactions, error boundaries, component tracking, and SSR coverage that plain `@sentry/browser` would lose. If a framework is found it stops and redirects to the appropriate skill or package. It then detects the installation method: a bundler project with package.json (npm path), a CMS or static site without npm (Loader Script path), or static HTML without Loader Script access (CDN bundle path), and checks for an existing Sentry installation.
Phase 2 (Recommend) leads with a concrete proposal rather than open questions, treating error monitoring as a non-negotiable baseline and tracing as high-value for interactive pages, with session replay for user-facing and checkout flows. Optional features include user feedback, logging (npm or CDN logs bundle only—not available via the Loader Script), and profiling (beta, Chromium-only, requiring the `Document-Policy: js-profiling` response header). Phase 3 (Guide) provides install commands for npm, yarn, and pnpm, and instructs creating a dedicated `src/instrument.ts` sidecar so `Sentry.init()` runs before any other code. Throughout, it advises verifying APIs against the official Sentry JavaScript docs before implementing.
FAQ
When should I use this skill instead of a framework SDK?
Use it for vanilla JavaScript, jQuery, static sites, and CMS platforms like WordPress with no framework-specific SDK. If React, Next.js, Vue, Angular, Svelte, Remix, Nuxt, Astro, or Ember is detected, it stops and redirects you to the matching SDK.
What installation paths does it support?
Three: Path A (npm/yarn/pnpm) for bundler projects with full features and source maps, Path B (Loader Script) for WordPress/Shopify/static HTML with no build tooling, and Path C (CDN bundle) for static HTML without Loader Script access.
Where should Sentry.init() be placed?
In a dedicated sidecar file such as `src/instrument.ts`, imported before any other code, because Sentry must initialize before the rest of the application runs.
Which features are recommended by default?
Error monitoring (always, the baseline), tracing (always for interactive pages), and session replay (for user-facing, support, or checkout flows). User feedback, logging, and profiling are optional enhancements.
Is logging available with the Loader Script?
No. Logging via `Sentry.logger.*` requires the npm path or the CDN logs bundle and is not available through the Loader Script. Profiling additionally is Chromium-only, in beta, and needs a `Document-Policy: js-profiling` header.
Install sentry-browser-sdk
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
getsentry/sentry-for-ai