User Feedback

When a user experiences an error, Sentry provides the ability to collect additional feedback. You can collect feedback according to the method supported by the SDK.

User Feedback API

The user feedback API provides the ability to collect user information when an event occurs. You can use the same programming language you have in your app to send user feedback. In this case, the SDK creates the HTTP request so you don't have to deal with posting data via HTTP.

Sentry pairs the feedback with the original event, giving you additional insight into issues. Sentry needs the eventId to be able to associate the user feedback to the corresponding event. For example, to get the eventId, you can use beforeSend or the return value of the method capturing an event.

import Sentry

let eventId = SentrySDK.capture(message: "My message.")

let userFeedback = UserFeedback(eventId: eventId)
userFeedback.comments = "It broke." = "" = "John Doe"
SentrySDK.capture(userFeedback: userFeedback)

To capture user feedback regarding a crash, use the SentryOptions.onCrashedLastRun callback. This callback gets called shortly after the initialization of the SDK when the last program execution terminated with a crash. It is not guaranteed that this is called on the main thread.

import Sentry

SentrySDK.start { options in
    options.dsn = ""
    options.onCrashedLastRun = { event in
        // capture user feedback
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").
Suggest an edit to this page   |  Contribute to Docs   |  

Report a Problem

🎉 Thank you for your feedback! 🙌
Report a problem