GithubHelp home page GithubHelp logo

robyedlin / sentry-module Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nuxt-community/sentry-module

0.0 1.0 0.0 119 KB

Sentry module for NuxtJS

License: MIT License

JavaScript 98.23% Vue 1.77%

sentry-module's Introduction

@nuxtjs/sentry

npm (scoped with tag) npm CircleCI Codecov Dependencies js-standard-style

Sentry module for Nuxt.js

Features

The module enables error logging through Sentry.

Please note that version 2.0.0 of this package introduces a breaking change. See #30 for more information.

Setup

  • Add @nuxtjs/sentry dependency using yarn or npm to your project
  • Add @nuxtjs/sentry to modules section of nuxt.config.js
{
  modules: [
    '@nuxtjs/sentry',
  ],

  sentry: {
      public_key: '',
      project_id: '',
      config: {
        // Additional config
      },
    }
}

Nuxt compatibility

Versions of NuxtJS between v1.0.0 and v1.2.1 are not supported by this package.

Usage

Enter your DSN in the NuxtJS config file. Additional config settings can be found here.

Usage in Vue component

In a Vue component, Sentry is available as this.$sentry, so we can call functions like

this.$sentry.captureException(new Error('example'))

where this is a Vue instance.

Options

Options can be passed using either environment variables or sentry section in nuxt.config.js. Normally setting required DSN information would be enough.

dsn

  • Type: String
    • Default: process.env.SENTRY_DSN

public_key

  • Type: String
    • Default: process.env.SENTRY_PUBLIC_KEY

Will be ignored if dsn provided.

host

  • Type: String
    • Default: process.env.SENTRY_HOST || 'sentry.io'

Will be ignored if dsn provided.

protocol

  • Type: String
    • Default: process.env.SENTRY_PROTOCOL || 'https'

Will be ignored if dsn provided.

project_Id

  • Type: String
    • Default: process.env.SENTRY_PROJECT_ID || ''

Will be ignored if dsn provided.

path

  • Type: String
    • Default: process.env.SENTRY_PATH || '/'

Will be ignored if dsn provided.

disabled

  • Type: Boolean
    • Default: process.env.SENTRY_DISABLED || false

disableClientSide

  • Type: Boolean
    • Default: process.env.SENTRY_DISABLE_CLIENT_SIDE || false

License

MIT License

Copyright (c) Diederik van den Burger [email protected]

sentry-module's People

Contributors

aldarund avatar anteriovieira avatar atinux avatar btkostner avatar dariye avatar darkside73 avatar diederikvandenb avatar mirucon avatar nerijunior avatar paulgv avatar rickmak avatar zakhse avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.