Skip to content

rapidez/sentry

Repository files navigation

Rapidez Sentry

This package integrates Sentry Laravel and Sentry Vue into a Rapidez project.

Installation

yarn add @sentry/vue --dev
composer require rapidez/sentry

You will need to add the following lines to your .env:

SENTRY_LARAVEL_DSN=___PUBLIC_DSN___
VITE_SENTRY_DSN="${SENTRY_LARAVEL_DSN}"

You don't need the VITE_SENTRY_DSN line if you don't want to use the Sentry Vue package. Note that setting your Sentry DSN to be public like this is safe.

You can disable the Vue package in your .env by adding:

SENTRY_VUE_ENABLED=false

Configuration

You can publish the (vue-specific) config with:

php artisan vendor:publish --tag=rapidez-sentry-config

Some basic configuration settings for Vue can also be set in your env, for example:

SENTRY_VUE_SAMPLE_RATE=50
SENTRY_VUE_INTEGRATION_REPLAY=true

Check out the sentry/sentry-laravel readme for configuration of the laravel package.

Testing

Errors thrown directly from the browser console don't get caught by Sentry, so you can test whether or not the frontend error reporting works by sending a test error in the browser console with:

document.dispatchEvent(new Event('sentry-test-error'))

This functionality can be disabled in your .env:

SENTRY_VUE_ALLOW_TEST_ERRORS=false

License

GNU General Public License v3. Please see License File for more information.