Sentry can enrich your events for further investigation by storing additional files, such as config or log files, as attachments.

Uploading Attachments

You'll first need to import the SDK, as usual:

import * as Sentry from "@sentry/react-native";

Attachments live on the Scope and will be sent with all events.

// Add an attachment
Sentry.configureScope((scope) => {
  scope.addAttachment({ filename: "attachment.txt", data: "Some content" });

// Clear attachments
Sentry.configureScope((scope) => {

An attachment has the following fields:

The filename is required and will be displayed in

The content of the attachment is required and is either a string or Uint8Array.

The type of content stored in this attachment. Any MIME type may be used; the default is application/octet-stream.

Add or Modify Attachments Before Sending

It's possible to add, remove, or modify attachments before an event is sent by way of the beforeSend hook or a global event processor.

  dsn: "",
  beforeSend: (event, hint) => {
    hint.attachments = [{ filename: "screenshot.png", data: captureScreen() }];
    return event;

Sentry.addGlobalEventProcessor((event, hint) => {
  hint.attachments = [{ filename: "log.txt", data: readLogFile() }];
  return event;

Attachments persist for 30 days; if your total storage included in your

quotaThe monthly number of events that you pay Sentry to track.
is exceeded, attachments will not be stored. You can delete attachments or their containing events at any time. Deleting an attachment does not affect your quota - Sentry counts an attachment toward your quota as soon as it is stored.

Learn more about how attachments impact your quota.

Access to Attachments

To limit access to attachments, navigate to your organization's General Settings, then select the Attachments Access dropdown to set appropriate access — any member of your organization, the organization billing owner, member, admin, manager, or owner.

Attachments Access

By default, access is granted to all members when storage is enabled. If a member does not have access to the

projectRepresents your service in Sentry and allows you to scope events to a distinct application.
, the ability to download an attachment is not available; the button will be greyed out in Sentry. The member may only view that an attachment is stored.

Viewing Attachments

Attachments display on the bottom of the Issue Details page for the event that is shown.

Attachments Access Denied

Alternately, attachments also appear in the Attachments tab on the Issue Details page, where you can view the Type of attachment, as well as associated events. Click the Event ID to open the Issue Details of that specific event.

Attachments List Example

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").
Suggest an edit to this page   |  Contribute to Docs   |  

Report a Problem

🎉 Thank you for your feedback! 🙌
Report a problem