getsentry / getsentry/sentry-react-native

Provide a Public Screenshot Capture API in Sentry React Native

Ouverte
#4,613 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Attachments Improvement React-Native
Langage dominant
TypeScript
Étoiles
1.8k
Forks
366
Merge moyen
1 j 6 h
PR mergées (30 j)
94

Description

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!

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par examiner le flux existant de capture de captures d’écran utilisé par Sentry.captureMessage(...) ainsi que les API semi-privées mentionnées dans l’issue. Définissez l’API publique de capture, les options de confidentialité par appel et les exigences de gestion des pièces jointes pour les workflows demandés. Le travail est considéré comme terminé lorsque le feedback personnalisé peut capturer une capture d’écran indépendamment et accepter l’image obtenue via l’interface de pièces jointes proposée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
react-native, typescript
Domaine
api, mobile
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.