To use Sentry with your Vue application, you will need to use Sentry’s browser JavaScript SDK: @sentry/browser.

# Using yarn
$ yarn add @sentry/browser

# Using npm
$ npm install @sentry/browser

On its own, @sentry/browser will report any uncaught exceptions triggered by your application.

Additionally, the Vue integration will capture the name and props state of the active component where the error was thrown. This is reported via Vue’s config.errorHandler hook.

Starting with version 5.x our Vue integration lives in its own package @sentry/integrations. You can install it with npm / yarn:

# Using yarn
yarn add @sentry/integrations

# Using npm
npm install @sentry/integrations

Then add this to your app.js:

import Vue from 'vue'
import * as Sentry from '@sentry/browser';
import { Vue as VueIntegration } from '@sentry/integrations';

  dsn: '___PUBLIC_DSN___',
  integrations: [new VueIntegration({Vue, attachProps: true})],

Additionally, Integrations.Vue accepts a few different configuration options that let you change its behavior:

  • Passing in Vue is optional, if you do not pass it window.Vue must be present.
  • Passing in attachProps is optional and is true if it is not provided. If you set it to false, Sentry will suppress sending all Vue components’ props for logging.
  • Passing in logErrors is optional and is false if it is not provided. If you set it to true, Sentry will call original Vue’s logError function as well.

In case you are using the CDN version or the Loader, we provide a standalone file for every integration, you can use it like this:

<!-- Note that we now also provide a es6 build only -->
<!-- <script src="" integrity="sha384-cu5ztPE89R7sai/T9ULehSJBqKr4ohibA8HeGS077KJbDhUUUbHDZb3SybR/J3GA" crossorigin="anonymous"></script> -->
<script src="" integrity="sha384-8XeHBuZ2XhMbhyH74W/+6MLGL3PfryfC87kUgxZXJ/z3cUmSETfEZLMo4CPVxh1r" crossorigin="anonymous"></script>

<!-- If you include the integration it will be available under Sentry.Integrations.Vue -->
<script src="" crossorigin="anonymous"></script>

    dsn: '___PUBLIC_DSN___',
    integrations: [new Sentry.Integrations.Vue({Vue, attachProps: true})],
On this page