getsentry / getsentry/sentry-react-native

Provide a Public Screenshot Capture API in Sentry React Native

オープン
#4,613 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
Attachments Improvement React-Native
主要言語
TypeScript
スター
1.8k
フォーク
366
平均マージ
1日 6時間
マージ済み PR(30日)
94

説明

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!

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、Sentry.captureMessage(...) で使用されている既存のスクリーンショット取得フローと、issue で言及されている準プライベート API を確認します。要求されたワークフロー全体で、公開キャプチャ API、呼び出しごとのプライバシーオプション、添付ファイル処理の要件を定義します。カスタムフィードバックが独立してスクリーンショットを取得し、提案された添付ファイルインターフェースを通じて取得した画像を受け取れることを完了条件とします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react-native, typescript
領域
api, mobile
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。