---
title: Collecting user feedback
description: Collect user feedback when errors occur in JavaScript applications to get context directly from affected users.
url: https://docs.honeybadger.io/lib/javascript/errors/collecting-user-feedback/
---

We don’t want our users to be interrupted by errors, but sometimes it does happen. Honeybadger helps you work with your users to fix errors by allowing them to leave feedback when an error occurs.

## Displaying a feedback form

A form to collect user feedback can be displayed as a modal dialog.

![Feedback form](https://docs.honeybadger.io/_astro/collecting-user-feedback-img.Ux2eAsic_Z2qdgJY.webp)

Honeybadger will link this feedback with the last error reported, hence it is required that an error needs to be reported first before displaying it.

```javascript
// we have to wait for the error to be reported and then call `showUserFeedbackForm()`
Honeybadger.notify(error, {
  afterNotify: () => {
    Honeybadger.showUserFeedbackForm();
  },
});
```

Note

Calling `Honeybadger.showUserFeedbackForm()` before an error is successfully reported to Honeybadger will not show the form dialog.

Additionally, you may choose to always the feedback form for every error that occurs by setting a global `afterNotify` handler:

```javascript
Honeybadger.afterNotify((err, notice) => {
  Honeybadger.showUserFeedbackForm();
});
```

## Form customization

You can customize all the messages and labels of the form simply by setting an options object when calling `Honeybadger.showUserFeedbackForm()`. The following customization is available (the defaults are shown):

```javascript
Honeybadger.showUserFeedbackForm({
  messages: {
    heading: "Care to help us fix this?",
    explanation:
      "Any information you can provide will help our technical team get to the bottom of this issue.",
    thanks: "Thanks for the feedback!",
  },
  buttons: {
    submit: "Send",
    cancel: "Cancel",
  },
  labels: {
    name: "Name",
    email: "Your email address",
    comment: "Comment (required)",
  },
});
```

## Viewing user feedback

You can find feedback from your users under the *Comments* tab of a Honeybadger error.

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
