getsentry / getsentry/sentry-react-native

Provide a Public Screenshot Capture API in Sentry React Native

Đang mở
#4,613 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Attachments Improvement React-Native
Ngôn ngữ chính
TypeScript
Star
1.8k
Fork
366
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
94

Mô tả

Hello Sentry team!

Thank you for the fantastic work you’ve done so far!

I have a feature request related to capturing screenshots in Sentry React Native—particularly for user feedback scenarios.

Currently, screenshots are primarily captured (if enabled) through Sentry’s `Sentry.captureMessage(...)` process, in case of error, or by using semi-private APIs. This makes it difficult to integrate screenshots into custom user feedback workflows, especially for those of us who rely on Sentry’s built-in privacy filtering instead of a third-party library.

## Below are the key features I’d love to see:

1. Public Screenshot Capture with Configurable Privacy Options

- A documented, supported method that allows screenshots to be captured independently of `captureMessage` or generating an exception.
- When a user explicitly requests a screenshot, it should be possible to adjust or disable privacy filters if necessary.
Ideally, this configuration could happen on a per-call basis for maximum flexibility (e.g. aka 'shake to send feedback').

2. (Optional/Stage2 impl) Binary Data Return

- Instead of returning raw binary data only, provide the native file path to the screenshot.
- This approach reduces overhead and makes the file immediately available for editing or annotation. It would allow developers to pass the image to an editor so users can draw notes or highlight specific areas—without keeping large binary arrays in memory.

3. Flexible Attachment Handling

- The ability to submit feedback without bundling the entire screenshot data object:
```
const userFeedback: SendFeedbackParams = { ... }
...

attachments.push({
filename: image.name || `image_${attachments.length}.jpg`,
data: imageData, // large blob of binary data
contentType: image.mediaContentType,
})

```
- For instance, accept a local file URI instead of a Uint8Array or string only.

Thank you for considering this request, and I’m happy to discuss potential approaches or provide further details!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách xem xét luồng chụp screenshot hiện có được Sentry.captureMessage(...) sử dụng và các API bán riêng tư được đề cập trong issue. Xác định API chụp công khai, các tùy chọn quyền riêng tư cho từng lần gọi và các yêu cầu xử lý tệp đính kèm trong các workflow được yêu cầu. Công việc được xem là hoàn tất khi custom feedback có thể tự chụp screenshot và tiếp nhận hình ảnh kết quả thông qua giao diện tệp đính kèm được đề xuất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react-native, typescript
Lĩnh vực
api, mobile
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.