-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Core or SDK?
Platform/SDK
Which part? Which one?
platforms/react-native/enriching-events/user-feedback/
Description
I'm trying to implement the user-feedback so I can capture some descriptive information of what was happening at the time of the error to cause it (and I aim to make this available in the aftermath of an error, via a screen I have setup for 'Bug Reports', so once the app/user has recovered from the error).
The documentation page for the user-feedback on react-native currently shows the feedback form widget which is available in browsers and doesn't clearly describe how a developer in react-native would go about getting user-feedback uploaded.
This page subsequently links to submit-user-feedback and suggests an api request if you don't have access to the form or don't want to use it (yet this is discouraged in other parts of the docs so it would be ideal if this was included in the SDK as an option to post it even if the form is done manually by the developer.
Another reason the above is not ideal is because it would seem the Sentry.lastEventId
is no longer available in recent SDK's, apparently it's only available in react-native via the Sentry. setEventSentSuccessfully
?
I only found this via the issue: getsentry/sentry-react-native#500) and still not sure how I'd be able to get this over to where I'm attempting to capture this user-feedback - overall its just a little confusing and some hurdles that we can work on to simplify the process, as the rest of the SDK allows for such a seamless setup.
Suggested Solution
There would be a few things that would make the whole process easier.
Ideally providing an SDK encapsulated way of sending user-feedback (I'm not suggesting the widget like on browsers, just adding a Sentry.captureUserFeedback()
rather than having to do a string interpolation of the const apiUrl = \
https://sentry.io/api/0/projects/${SENTRY_ORGANIZATION_SLUG}/${SENTRY_PROJECT_SLUG}/user-feedback/\`` would make things nicer as it avoid having half of the available API covered by the SDK.
Adding documentation specific to React-Native which describes the differences in how to obtain and use the Sentry.lastEventId
as I wasn't able to find this clearly in the documentation (only in the github issue linked before).
If not then adding clearer examples on how to attach the event_id which is a required parameter in the user-feedback, and removing the linking of documentation that relates to ordinary browser based documentation when we've selected React-Native would definitely help.