Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a Public Screenshot Capture API in Sentry React Native #4613

Open
bondarenkod opened this issue Mar 3, 2025 · 1 comment
Open

Provide a Public Screenshot Capture API in Sentry React Native #4613

bondarenkod opened this issue Mar 3, 2025 · 1 comment

Comments

@bondarenkod
Copy link

bondarenkod commented Mar 3, 2025

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').
  1. (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.
  1. 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!

@krystofwoldrich
Copy link
Member

@bondarenkod Thank you for the request and the explanation why. It makes sense to me, we will discuss internally and post an update soon here in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Needs Discussion
Development

No branches or pull requests

2 participants