Skip to main content
This quickstart guide will help you set up Sentry in a browser application. For platform-specific instructions, see the Installation section.

Prerequisites

Before you begin, make sure you have:
  • A Sentry account and project (sign up at sentry.io)
  • Your Sentry DSN (Data Source Name) from your project settings
  • Node.js installed (for package management)
Don’t have a Sentry account? Sign up for free to get started.

Step 1: Install the SDK

Choose your preferred package manager to install the Sentry SDK:

Step 2: Initialize Sentry

Initialize Sentry as early as possible in your application, before any other code runs:
main.ts
Replace YOUR_DSN_HERE with your actual Sentry DSN from your project settings.

Step 3: Verify Installation

Test that Sentry is working correctly by triggering a test error:
Alternatively, you can trigger an error directly in your code:

Step 4: View Your Error

After triggering the test error:
  1. Go to your Sentry dashboard
  2. Select your project
  3. Navigate to Issues
  4. You should see your test error appear within seconds
If you see your error in Sentry, congratulations! Your integration is working correctly.

What’s Next?

Now that you have Sentry set up, explore these features to get the most out of error monitoring:

Add Context

Attach user information, tags, and custom context to errors

Track Breadcrumbs

Automatically track user actions leading up to errors

Monitor Performance

Set up distributed tracing and performance monitoring

Session Replay

Enable session replay to see exactly what users experienced

Platform-Specific Quickstarts

Choose your framework for more detailed installation instructions:
See the full React installation guide for ErrorBoundary setup and more.

Common Configuration Options

Here are some commonly used configuration options:
string
required
Your project’s DSN (Data Source Name) from Sentry
string
default:"production"
The environment your application is running in (e.g., production, staging, development)
string
The release version of your application for tracking deployments
number
default:"0"
Sample rate for performance monitoring (0.0 to 1.0, where 1.0 = 100%)
function
Callback function to filter or modify events before sending to Sentry
Integration[]
Array of integration objects to enable additional features
See the full Configuration Options reference for all available options.

Advanced Setup

Upload source maps to see readable stack traces in production:
See the Source Maps guide for detailed instructions.
Use beforeSend to filter out unwanted errors:
See the Filtering guide for more examples.
Add user information to all captured errors:
See the Context guide for more details.
Add custom tags to organize and filter errors:
See the Tags documentation for best practices.

Getting Help

Documentation

Explore the full documentation

GitHub

View source code and examples

Discord

Join our community chat
Having issues? Check out our troubleshooting guide or ask for help in our Discord community.