explaingit

getsentry/sentry-javascript

8,650TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

The official JavaScript SDKs for Sentry error tracking, install one package for your platform (React, Node.js, Next.js, Vue, etc.) and crashes are automatically captured and sent to your Sentry dashboard with three lines of setup code.

Mindmap

mindmap
  root((sentry-javascript))
    What it does
      Capture JS errors
      Send crash reports
      Auto error detection
    Platforms
      Browser apps
      Node.js servers
      React Vue Next.js
      Serverless functions
    Setup
      npm install package
      Three-line init call
      Monorepo structure
    Audience
      Web developers
      Full-stack teams
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Automatically capture and report JavaScript errors to a Sentry dashboard by adding three lines of initialization code

USE CASE 2

Add error tracking to a React, Vue, or Next.js app using the matching @sentry scoped package

USE CASE 3

Monitor crashes and exceptions in a Node.js or Deno server application

USE CASE 4

Track errors in an AWS Lambda or Cloudflare Workers serverless function with a platform-specific Sentry package

Tech stack

TypeScriptJavaScriptNode.jsReactVueAngularnpm

Getting it running

Difficulty · easy Time to first run · 5min

Requires a free Sentry account to get a project DSN key before initialization.

In plain English

This repository contains the official JavaScript SDKs for Sentry, a commercial error tracking and monitoring service. When something breaks in a web application or server-side JavaScript code, Sentry captures the crash details automatically and sends them to a dashboard where developers can investigate. These SDKs are the code you install into your own project to enable that reporting. The repository covers a wide range of JavaScript environments rather than a single package. There are separate SDK packages for browsers, Node.js servers, and popular frameworks including React, Vue, Angular, Svelte, Next.js, Remix, Gatsby, and several others. Cloud-specific packages exist for AWS Lambda and Google Cloud Functions, and there are packages for Electron desktop apps, React Native mobile apps, Deno, Bun, and Cloudflare Workers. Each platform-specific package builds on a shared core library that handles the common logic. Setup follows the same pattern regardless of platform: install the package for your environment, call an initialization function with your account identifier, and Sentry begins capturing errors automatically. The README shows a three-line setup example. After that, errors that occur in your application are sent to the Sentry service without you needing to write any additional logging code, though you can also send messages manually. The package naming follows the @sentry/ convention on npm, so you install something like @sentry/react or @sentry/node depending on your stack. The repository is structured as a monorepo, meaning all these packages live together in one codebase but are published independently. Sentry runs a bug bounty program for security vulnerabilities in this codebase, currently invitation-only. Researchers interested in auditing the SDK can contact the security team by email. The project is open source and accepts community contributions, with a contributor guide linked from the README.

Copy-paste prompts

Prompt 1
Show me how to set up @sentry/react in a React 18 app to automatically capture unhandled errors and send them to my Sentry project DSN.
Prompt 2
I'm using Next.js 14. Walk me through installing and configuring @sentry/nextjs to capture errors on both the client side and server side.
Prompt 3
Write a Node.js Express server that uses @sentry/node to capture unhandled errors, including a test endpoint that deliberately throws an error to verify the setup.
Prompt 4
How do I add Sentry to an AWS Lambda function using @sentry/aws-serverless and what environment variables do I need to set?
Prompt 5
Using the Sentry JavaScript SDK, how do I manually capture a custom error and attach extra context tags like user ID and plan tier to the event?
Open on GitHub → Explain another repo

← getsentry on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.