On this page, we get you up and running with Sentry's SDK, so that it will automatically report errors and exceptions in your application.

Don't already have an account and Sentry project established? Head over to, then return to this page.


Sentry captures data by using an SDK within your application’s runtime.

npm install --save  @sentry/vue @sentry/tracing


Configuration should happen as early as possible in your application's lifecycle.

To initialize Sentry in your Vue application, add this to your app.js:

import Vue from "vue";
import * as Sentry from "@sentry/vue";
import { Integrations } from "@sentry/tracing";

  Vue: Vue,
  dsn: "",
  integrations: [new Integrations.BrowserTracing()],

  // We recommend adjusting this value in production, or using tracesSampler
  // for finer control
  tracesSampleRate: 1.0,

Sentry's Vue SDK 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 set 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 set to true, Sentry will call original Vue's logError function as well.


This snippet includes an intentional error, so you can test that everything is working as soon as you set it up:

Add a button to your page that throws an error:

// ...
<button :onClick="throwError" />
    Throw error
// ...

export default {
  // ...
  methods: {
    throwError: function() {
        throw new Error('Sentry Error')

To view and resolve the recorded error, log into and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").