sentry-browser-sdk

Install and initialize @sentry/browser for error monitoring and tracing.

Updated Jul 4, 2021
One-click install
npx skills add https://github.com/Valor-mmm/time-calculator --skill sentry-browser-sdk-valor-mmm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sentry-browser-sdk
Source: https://github.com/Valor-mmm/time-calculator/tree/main/.agents/skills/sentry-browser-sdk
Command: npx skills add https://github.com/Valor-mmm/time-calculator --skill sentry-browser-sdk-valor-mmm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a straightforward, end-to-end setup workflow for the Sentry Browser SDK, enabling reliable browser-based error monitoring, performance tracing, and session replay across vanilla JavaScript apps, WordPress sites, and static pages.

Core Features & Use Cases

  • Automatic error capture for uncaught exceptions and unhandled promise rejections
  • Page load and navigation tracing, plus session replay for user sessions
  • Optional logging and advanced features via npm/CDN bundles
  • Real-world example: quickly instrument a static HTML site to report errors and user sessions to Sentry

Quick Start

Install the Sentry Browser SDK and initialize it with your DSN to begin monitoring.

Frequently Asked Questions about sentry-browser-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I install and configure Sentry error monitoring for a vanilla JavaScript web app?

To set up Sentry error monitoring, install the @sentry/browser package and initialize the SDK with your project DSN. This enables automatic capture of uncaught exceptions and unhandled promise rejections across your application.

Can I use the Sentry Browser SDK to add performance tracing and session replay to a static site?

Yes, the Sentry Browser SDK supports performance tracing and session replay for static sites. You can initialize the SDK with frontmatter-defined options to load relevant integrations, capturing both page load navigation timings and user session replays.

Does the Sentry Browser SDK work with WordPress sites for tracking uncaught exceptions?

The Sentry Browser SDK works with WordPress sites to track uncaught exceptions. By installing @sentry/browser and configuring your DSN, you can enable reliable browser-based error monitoring across vanilla JavaScript apps and WordPress pages.

What is the best way to initialize Sentry tracing with environment-specific configurations?

The best way to initialize Sentry tracing is to configure the DSN and environment variables during SDK initialization. Using frontmatter-defined options allows you to selectively load relevant integrations for error capture, tracing, and optional logging.

Do I need npm to install Sentry error monitoring, or can I use a CDN bundle?

You do not strictly need npm to install Sentry error monitoring; the SDK can also be loaded via CDN bundles. Both npm and CDN approaches allow you to initialize the SDK, configure your DSN, and enable advanced features like session replay.

Why are my Sentry browser integrations not capturing unhandled promise rejections correctly?

Unhandled promise rejections may not be captured if the Sentry Browser SDK is not properly initialized with the correct DSN and environment configurations. Ensure you load the relevant integrations using frontmatter-defined options during the SDK setup process.