Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@infermedica/vue-sentry-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@infermedica/vue-sentry-plugin

Sentry plugin for Vue applications.

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Infermedica Vue Sentry Plugin

This package provides a simple vue plugin to configure Sentry.

Installation

$ npm install --save-dev @infermedica/vue-sentry-plugin

Configuration

The Sentry plugin has to be configured in Webpack configuration file through webpack.DefinePlugin:

new webpack.DefinePlugin({
  __sentry: JSON.stringify({
    isEnabled: process.env.NODE_ENV === 'production',
    dsn: 'https://XXX@sentry.io/XXX',
    environment: process.env.NODE_ENV === 'production' ? 'production' : 'local',
    release: '<release-identifier>'
  })
})

Usage

To use the module, just import the VueSentry object and install the plugin in Vue.

import VueSentry from '@infermedica/vue-sentry-plugin';

Vue.use(VueSentry);

The plugin will be avaliabe under VueSentry and in components under this.$sentry.

This plugin automatically sets two Sentry tags:

  • "instance" to the value of window.location.hostname
  • "event_layer" to the value "frontend"

Set additional global Sentry tags

this.$sentry.setTag('tag_name', 'tag_value');

Set active user in Sentry

this.$sentry.setUser(currentUser.id, currentUser.username, currentUser.name);

Set active interface language in Sentry

this.$sentry.setActiveInterfaceLanguage('en');

This just sets a tag 'i18n.locale' to given value.

Access Sentry object

The global Sentry object is also avaliable through the plugin, so one can access the core sentry functionality.

this.$sentry.Sentry

Contribution

We're happy to accept pull requests with additional integrations. Feel free to raise an issue if you have any questions or suggestions.

License

MIT Copyright (c) Infermedica

Keywords

FAQs

Package last updated on 22 Jun 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc