🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

@nuxtjs/sentry

Package Overview
Dependencies
Maintainers
4
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxtjs/sentry - npm Package Compare versions

Comparing version
0.0.2
to
0.1.0
+10
-0
CHANGELOG.md

@@ -5,3 +5,13 @@ # Change Log

<a name="0.1.0"></a>
# [0.1.0](https://github.com/nuxt-community/sentry-module/compare/v0.0.2...v0.1.0) (2017-10-24)
### Features
* more options ([cbca975](https://github.com/nuxt-community/sentry-module/commit/cbca975))
<a name="0.0.2"></a>
## [0.0.2](https://github.com/nuxt-community/sentry-module/compare/v0.0.1...v0.0.2) (2017-10-17)
+37
-3
const Raven = require('raven')
const path = require('path')
module.exports = async function sentry (options) {
module.exports = async function sentry (moduleOptions) {
// Merge options
const options = Object.assign({
disableClientSide: process.env.SENTRY_DISABLE_CLIENT_SIDE || false,
dsn: process.env.SENTRY_DSN || null,
public_dsn: process.env.SENTRY_PUBLIC_DSN || null,
public_key: process.env.SENTRY_PUBLIC_KEY || null,
private_key: process.env.SENTRY_PRIVATE_KEY || null,
host: process.env.SENTRY_HOST || 'sentry.io',
protocol: process.env.SENTRY_PROTOCOL || 'https',
project_id: process.env.SENTRY_PROJECT_ID || '',
path: process.env.SENTRY_PATH || '/',
config: {
environment: this.options.dev ? 'development' : 'production'
}
}, this.options.sentry, moduleOptions)
// Generate DSN
// https://docs.sentry.io/quickstart/#about-the-dsn
if (!options.dsn || !options.dsn.length) {
options.dsn = `${options.protocol}://${options.public_key}:${options.private_key}@${options.host}${options.path}${options.project_id}`
}
// Public DSN (without private key)
if (!options.public_dsn || !options.public_dsn.length) {
options.public_dsn = options.dsn.replace(/:\w+@/, '@')
}
// Setup raven
Raven.config(`https://${options.public_key}:${options.private_key}@sentry.io/${options.project_id}`, options.config).install()
Raven.config(options.dsn, options.config).install()
// Register the client plugin
this.addPlugin({ src: path.resolve(__dirname, 'templates/sentry-client.js'), options })
if (!options.disableClientSide) {
this.addPlugin({
src: path.resolve(__dirname, 'templates/sentry-client.js'),
fileName: 'sentry-client.js',
ssr: false,
options
})
}

@@ -11,0 +45,0 @@ // Hook in to Nuxt renderer

+1
-1

@@ -6,4 +6,4 @@ import Vue from 'vue'

Raven
.config(`https://${options.public_key}@sentry.io/${options.project_id}`, <%= serialize(options.config) %>)
.config('<%= options.public_dsn %>', <%= serialize(options.config) %>)
.addPlugin(RavenVue, Vue)
.install()
{
"name": "@nuxtjs/sentry",
"version": "0.0.2",
"version": "0.1.0",
"description": "Sentry module for Nuxt.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -22,3 +22,6 @@ # @nuxtjs/sentry

modules: [
['@nuxtjs/sentry', {
'@nuxtjs/sentry',
],
sentry: {
public_key: '',

@@ -28,7 +31,5 @@ private_key: '',

config: {
environment: process.env.NODE_ENV !== 'production' ? 'development' : 'production',
// Additional config
},
}],
]
}
}

@@ -41,2 +42,55 @@ ```

## 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_dsn
- Type: `String`
- Default: `process.env.SENTRY_PUBLIC_DSN`
If value omitted it will be generated using `dsn` value, by removing private key part.
### public_key
- Type: `String`
- Default: `process.env.SENTRY_PUBLIC_KEY`
Will be ignored if `dsn` provided.
### private_key
- Type: `String`
- Default: `process.env.SENTRY_PRIVATE_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.
### disableClientSide
- Type: `Boolean`
- Default: `process.env.SENTRY_DISABLE_CLIENT_SIDE || false`
## License

@@ -43,0 +97,0 @@