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. To get the eventId
, for example, you can use the beforeSend or the return value of the methods capturing an event.
Copied
import 'package:sentry/sentry.dart';
SentryId sentryId = Sentry.captureMessage("My message");
final feedback = SentryUserFeedback(
eventId: sentryId,
comments: 'Hello World!',
email: 'foo@bar.org',
name: 'John Doe',
);
Sentry.captureUserFeedback(userFeedback);
- Package:
- pub:sentry
- Version:
- 8.6.0
- Repository:
- https://github.com/getsentry/sentry-dart