GlitchTip is an open-source alternative to Sentry that works seamlessly with the Sentry browser SDK.
To get started, you have two options for including the Sentry SDK:
Add the following script tag to your HTML file.
<script src="https://browser.sentry-cdn.com/7.60.0/bundle.min.js" crossorigin="anonymous"></script>
Consider checking the Sentry GitHub repository for the latest available version number.
If you prefer using NPM for managing dependencies, you can install the Sentry SDK like this:
npm install @sentry/browser
Next, initialize the Sentry SDK as early as possible during your page load. Retrieve your DSN from your Glitchtip project settings and use it to configure the SDK. Additionally, you can set the tracesSampleRate
option to specify the rate at which performance monitoring data should be sent (e.g., 0.01
for 1% of transactions).
Sentry.init({
dsn: "YOUR-GLITCHTIP-DSN-HERE",
tracesSampleRate: 0.01,
});
To ensure that error reporting works correctly, you can create a simple test by calling an undefined function:
myUndefinedFunction();