Skip to main content

Sentry JavaScript SDK

Monitor errors, track performance, and improve user experience across all JavaScript platforms with Sentry’s comprehensive SDK suite.

What is Sentry JavaScript SDK?

Sentry JavaScript SDK is a comprehensive suite of error monitoring and performance tracking libraries for JavaScript applications. With over 40 platform-specific SDKs, Sentry provides deep integration with your JavaScript stack—from vanilla browser apps to full-stack frameworks like Next.js, SvelteKit, and Remix.

Key Features

Error Monitoring

Automatically capture and report JavaScript errors with full context including stack traces, breadcrumbs, and user data

Performance Tracking

Monitor application performance with distributed tracing, spans, and real-time metrics powered by OpenTelemetry

Session Replay

Replay user sessions to see exactly what happened before an error occurred, including DOM interactions and console logs

AI Monitoring

Track AI model performance and errors with built-in integrations for OpenAI, Anthropic, LangChain, and more

Supported Platforms

Sentry provides first-class support for all major JavaScript environments and frameworks:

Browser

Vanilla JavaScript, TypeScript, and browser-based applications

Node.js

Server-side JavaScript with full OpenTelemetry instrumentation

React

Error boundaries, profiling, and React-specific integrations

Vue

Vue 2 and Vue 3 with composition API support

Angular

Error handling and tracing for Angular applications

Next.js

Full-stack monitoring for Next.js with server and client integration

SvelteKit

Isomorphic error tracking for SvelteKit applications

Remix

Server and client monitoring for Remix applications

Serverless

AWS Lambda, Google Cloud Functions, and edge runtimes

Quick Example

Here’s how simple it is to get started with Sentry in a browser application:
import * as Sentry from '@sentry/browser';

Sentry.init({
  dsn: 'YOUR_DSN_HERE',
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.replayIntegration(),
  ],
  tracesSampleRate: 1.0,
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});

// Errors are automatically captured
try {
  somethingThatMightFail();
} catch (error) {
  Sentry.captureException(error);
}
Each platform SDK is tailored to provide the best developer experience and deepest integration with your chosen framework.

Advanced Capabilities

Profiling

CPU profiling for Node.js applications to identify performance bottlenecks

User Feedback

Collect user feedback directly from your application when errors occur

Feature Flags

Track feature flag usage and correlate with errors and performance issues

Custom Integrations

Build custom integrations to extend Sentry’s capabilities for your specific needs

Next Steps

Quickstart Guide

Get up and running with Sentry in under 5 minutes

Choose Your Platform

Find installation instructions for your specific framework

Core Concepts

Learn about scopes, contexts, breadcrumbs, and more

API Reference

Explore the complete API documentation

Community & Support

GitHub

View source code and contribute

Discord

Join our community chat

Stack Overflow

Get help from the community