JulianMar / nuxt-bugsnag

Bugsnag module for nuxt.js
MIT License
49 stars 18 forks source link

How to enable only for production / staging server? #9

Closed simplenotezy closed 4 years ago

simplenotezy commented 4 years ago

I am not sure how I disable this locally. Currently I have:

notifyReleaseStages: ['staging', 'production']

However, where / how do I define what the current release stage is?

JulianMar commented 4 years ago

Hi you can use:

releaseStage: Settings.env.environment,

replacing the environement with you env :)

Ohh and btw. the notifyReleaseStages got changed to enabledReleaseStages in bugsnag 7

simplenotezy commented 4 years ago

@JulianMar So like this?

nuxt.config.js

    [ 'nuxt-bugsnag', {
        apiKey: '1234',
        reporterOptions: {
            releaseStage: process.env.ENVIRONMENT || 'local',
            autoAssignRelease: true
        },
        publishRelease: (process.env.ENVIRONMENT !== 'local'),
        notifyReleaseStages: [ 'staging', 'production' ],
        enabledReleaseStages: [ 'staging', 'production' ]
    } ],
JulianMar commented 4 years ago

this is how I use it:

[
      'nuxt-bugsnag',
      {
        apiKey: Settings.env.bugsnag_key,
        config: {
          enabledReleaseStages: ['production', 'dev'],
          releaseStage: Settings.env.environment,
          appVersion: Settings.env.version
        },
        publishRelease: Settings.env.environment === 'production'
      }
]