---
title: "RAM Bundle"
description: "Learn about packaging our React Native SDK with RAM Bundle."
url: https://docs.sentry.io/platforms/react-native/manual-setup/ram-bundles/
---

# RAM Bundle | Sentry for React Native

The [RAM bundle](https://reactnative.dev/docs/ram-bundles-inline-requires) format is a new approach to packaging React Native apps that optimizes your app's startup time. With RAM bundles, it is possible to load to memory only those modules that are needed for specific functionality, and only when needed.

All the existing RAM bundle formats are explained in detail in the [Metro Bundler documentation](https://facebook.github.io/metro/docs/bundling).

## [Enabling RAM Bundles](https://docs.sentry.io/platforms/react-native/manual-setup/ram-bundles.md#enabling-ram-bundles)

If you are using [Hermes](https://docs.sentry.io/platforms/react-native/manual-setup/hermes.md), you should not have the RAM bundles feature enabled. In Hermes, when loading the bytecode, `mmap` ensures that the entire file is not loaded. Using Hermes with RAM bundles might lead to issues, because those mechanisms are not compatible with each other.

To enable RAM bundles for your app, please consult with the [official React Native documentation](https://reactnative.dev/docs/ram-bundles-inline-requires#enable-the-ram-format).

If you use the official `react-native-sentry` integration of version `0.43.1` or newer, no additional actions are required. `sentry-cli`, which is used internally by the integration, will detect the bundle type automatically, and then upload the extracted modules to Sentry.

## [Uploading Bundles Manually](https://docs.sentry.io/platforms/react-native/manual-setup/ram-bundles.md#uploading-bundles-manually)

Starting from version `1.43.0`, `sentry-cli` provides two additional parameters to the `sourcemaps upload` command to simplify bundle uploads: `--bundle` and `--bundle-sourcemap`. Using those parameters, you can pass the path to the application bundle, along with its source map, and the bundle will be automatically extracted before the upload, if necessary:

```bash
node_modules/@sentry/cli/bin/sentry-cli sourcemaps upload \
    --release <release> \
    --dist <dist> \
    --strip-prefix $projectRoot/fullFolder \
    --bundle index.android.bundle \
    --bundle-sourcemap index.android.bundle.map
```

All bundle types (plain, Indexed RAM bundles, and File RAM bundles) are supported.

## [RAM Bundles and Performance](https://docs.sentry.io/platforms/react-native/manual-setup/ram-bundles.md#ram-bundles-and-performance)

The initial Sentry support for RAM bundles, added in `sentry-cli 1.43.0` and `react-native-sentry 0.43.1`, is known to have an upload performance issue when handling RAM bundles with a large number of modules. This will be fixed in future client versions.

By default, when running as part of Xcode build step (customarily called "Bundle React Native Code And Images"), `sentry-cli` uploads source maps to Sentry in the background. To make it run in the foreground and track its progress, you can add `--force-foreground` parameter to the `sentry-cli` command in your Xcode project configuration file `project.pbxproj`, so the command looks similar to:

```shell
./node_modules/@sentry/cli/bin/sentry-cli react-native xcode --force-foreground ../node_modules/react-native/scripts/react-native-xcode.sh
```
