sentry-javascript
Official Sentry SDKs for JavaScript
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.
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.
Where it fits
- Automatically capture and report JavaScript errors to a Sentry dashboard by adding three lines of initialization code
- Add error tracking to a React, Vue, or Next.js app using the matching @sentry scoped package
- Monitor crashes and exceptions in a Node.js or Deno server application
- Track errors in an AWS Lambda or Cloudflare Workers serverless function with a platform-specific Sentry package