Configuration

You can customize the Crash-Report modal to your organization's needs, for example, for localization purposes. All options can be passed through the Sentry.showReportDialog call.

ParamDefault
eventIdManually set the id of the event.
dsnManually set dsn to report to.
userManually set user data [an object with keys listed below].
user.emailUser's email address.
user.nameUser's name.
lang[automatic]override for Sentry’s language code
titleIt looks like we’re having issues.
subtitleOur team has been notified.
subtitle2If you’d like to help, tell us what happened below. – not visible on small screen resolutions
labelNameName
labelEmailEmail
labelCommentsWhat happened?
labelCloseClose
labelSubmitSubmit
errorGenericAn unknown error occurred while submitting your report. Please try again.
errorFormEntrySome fields were invalid. Please correct the errors and try again.
successMessageYour feedback has been sent. Thank you!
onLoadn/a - an optional callback that will be invoked when the widget opens
onClosen/a - an optional callback that will be invoked when the widget closes

The optional callback onLoad will be called when users see the widget. You can use this to run custom logic, for example to log an analytics event:

Copied
<script>
  Sentry.showReportDialog({
    // ...
    onLoad() {
      // Log an event to amplitude when the report dialog opens
      amplitude.logEvent("report_dialog_seen");
    },
  });
</script>

The optional callback onClose will be called when users close the widget. You can use this to run custom logic, for example to reload the page:

Requires JS SDK version v7.82.0 or higher.

Copied
<script>
  Sentry.showReportDialog({
    // ...
    onClose() {
      // Refresh the page after the user closes the report dialog
      location.reload();
    },
  });
</script>
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").