
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
@sentry/vue
Advanced tools
@sentry/vue is an official Sentry SDK for Vue.js applications. It allows developers to monitor and track errors, performance issues, and other events in their Vue.js applications. The package provides seamless integration with Vue.js, enabling automatic error tracking and performance monitoring.
Error Tracking
This feature allows you to initialize Sentry in your Vue.js application to automatically capture and report errors. The `dsn` is your Sentry Data Source Name, which uniquely identifies your project.
import * as Sentry from '@sentry/vue';
import { Integrations } from '@sentry/tracing';
import Vue from 'vue';
Sentry.init({
Vue: Vue,
dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: 1.0,
});
Performance Monitoring
This feature allows you to monitor the performance of your Vue.js application. You can track custom transactions and measure the performance of specific parts of your application.
import * as Sentry from '@sentry/vue';
import { Integrations } from '@sentry/tracing';
import Vue from 'vue';
Sentry.init({
Vue: Vue,
dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: 1.0,
});
// Example of a custom transaction
const transaction = Sentry.startTransaction({
op: 'test',
name: 'My Custom Transaction',
});
setTimeout(() => {
transaction.finish();
}, 99);
Manual Error Reporting
This feature allows you to manually capture and report exceptions in your Vue.js application. This is useful for capturing errors that are not automatically caught by Sentry.
import * as Sentry from '@sentry/vue';
import Vue from 'vue';
Sentry.init({
Vue: Vue,
dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
});
// Manually capture an exception
try {
throw new Error('This is a test error');
} catch (error) {
Sentry.captureException(error);
}
Bugsnag provides error monitoring and crash reporting for web and mobile applications. It offers similar functionalities to @sentry/vue, such as automatic error tracking and performance monitoring. Bugsnag also provides detailed error reports and supports various platforms, including Vue.js.
Rollbar is an error tracking and monitoring service that supports multiple languages and frameworks, including Vue.js. It offers real-time error reporting, automatic error grouping, and detailed error insights. Rollbar is comparable to @sentry/vue in terms of functionality and ease of integration.
Airbrake provides error monitoring and performance management for web applications. It supports Vue.js and offers features like real-time error tracking, detailed error reports, and performance monitoring. Airbrake is similar to @sentry/vue in its capabilities and integration process.
This package is a wrapper around @sentry/browser
, with added functionality related to Vue.js. All methods available in
@sentry/browser
can be imported from @sentry/vue
.
To use this SDK, call Sentry.init(options)
as early in your application as possible.
const app = createApp({
// ...
});
Sentry.init({
app,
dsn: '__PUBLIC_DSN__',
integrations: [
// Or omit `router` if you're not using vue-router
Sentry.browserTracingIntegration({ router }),
],
});
import Vue from 'vue';
import App from './App';
import router from './router';
import * as Sentry from '@sentry/vue';
Sentry.init({
Vue: Vue,
dsn: '__PUBLIC_DSN__',
integrations: [
// Or omit `router` if you're not using vue-router
Sentry.browserTracingIntegration({ router }),
],
});
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>',
});
9.9.0
feat(nextjs): Support instrumentation-client.ts
(#15705)
Next.js recently added a feature to support client-side (browser) instrumentation via a instrumentation-client.ts
file.
To be forwards compatible, the Sentry Next.js SDK will now pick up instrumentation-client.ts
files even on older Next.js versions and add them to your client bundles.
It is suggested that you either rename your sentry.client.config.ts
file to instrumentation-client.ts
, or if you already happen to have a instrumentation-client.ts
file move the contents of sentry.client.config.ts
to instrumentation-client.ts
.
feat(browser): Add previous_trace
span links (#15569)
The @sentry/browser
SDK and SDKs based on @sentry/browser
now emits a link from the first root span of a newly started trace to the root span of a previously started trace. You can control this feature via an option in browserTracingIntegration()
:
Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});
feat(browser): Add logger.X
methods to browser SDK (#15763)
For Sentry's upcoming logging product, the SDK now supports sending logs via dedicated methods.
Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation
Please note that the logs product is still in early access. See the link above for more information.
parseStringToURL
method (#15768)dropUndefinedKeys
(#15760)shouldHandleError
(#15771)addNonEnumerableProperty
(#15766)dropUndefinedKeys()
(#15757)dropUndefinedKeys()
(#15781)FAQs
Official Sentry SDK for Vue.js
The npm package @sentry/vue receives a total of 0 weekly downloads. As such, @sentry/vue popularity was classified as not popular.
We found that @sentry/vue demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Company News
Socket is bringing best-in-class reachability analysis into the platform — cutting false positives, accelerating triage, and cementing our place as the leader in software supply chain security.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.