Set Up User Feedback

Learn how to enable User Feedback in your Cocoa app.

The User Feedback feature allows you to collect user feedback from anywhere inside your application at any time, without needing an error event to occur first.

If you're using a self-hosted Sentry instance, you'll need to be on version 24.4.2 or higher in order to use the full functionality of the User Feedback feature. Lower versions may have limited functionality.

The User Feedback widget allows users to submit feedback from anywhere inside your application.

Ensure that your project is set up with Sentry and that you have added the Sentry Cocoa SDK to your project.

  1. Install the Sentry Cocoa SDK using CocoaPods, Carthage, or Swift Package Manager.
  2. Ensure you are using version 8.35.0 or above of the SDK to access the latest features.

To start using the User Feedback widget in your Cocoa application, enable the feedback integration and provide a configuration in your SentryOptions when starting the SDK:

Copied
 SentrySDK.start { options in
     options.configureUserFeedback = { config in
          config.onSubmitSuccess = { data in
               print("Feedback submitted successfully: \(data)")
          }
          config.onSubmitError = { error in
               print("Failed to submit feedback: \(error)")
          }
     }
 }

This setup will insert the widget into your app's view hierarchy. By default, it appears in the bottom trailing corner of the screen, but you can fully customize its appearance and behavior.

The User Feedback widget integrates seamlessly with Session Replay. When the widget is opened, the Replay SDK buffers up to 30 seconds of the user's session. If feedback is submitted, this replay is sent along with the feedback, allowing you to view both the feedback and the user's actions leading up to the feedback submission.

The User Feedback API allows you to collect user feedback while using your own UI components. You can submit feedback directly using the SentrySDK.capture(feedback:) method:

Copied
SentrySDK.capture(feedback: .init(
    message: "I encountered a bug while using the app.",
    name: "John Doe",
    email: "john.doe@example.com"
))

This method associates the feedback with the corresponding event in Sentry, giving you valuable insights into user issues.

Alternatively, you can use the User Feedback API endpoint directly if you prefer to handle the HTTP request manually.

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").