Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.41 KB

user-feedback.md

File metadata and controls

44 lines (33 loc) · 1.41 KB
title description position category
User Feedback
A feedback dialog for providing additional user information
25
Guide

When a user experiences an error, Sentry provides the ability to collect additional feedback through a feedback dialog.

Setup

showReportDialog is a function that should be called to trigger the User Feedback dialog. Due to how Nuxt works, we can't reference it directly from within Nuxt config as Sentry configuration is strinigified and the function reference does not survive that. We have to use the clientConfig option with a path to a custom client configuration that imports the function like so:

sentry: {
  dsn: '...',
  clientConfig: '~/config/sentry-client-config.js',
}
import { showReportDialog } from '@sentry/vue'

export default function(context) {
  return {
    beforeSend (event, hint) {
      if (event.exception) {
        showReportDialog({ eventId: event.event_id })
      }
      return event
    },
  }
}

The configuration provided through clientConfig is merged with the configuration provided in the Nuxt config so other configuration options can (but don't have to) be defined in Nuxt config.

Documentation

See Sentry's User Feedback pages for additional information.