To use Sentry together with CodePush, pass release and dist to Sentry.init. Our suggestion is to store them in an app.json, or you can just use the package.json. These values need to be unique to each version of your codebase and match the version on the source maps exactly, or they might not be symbolicated.

When you set a custom release and dist, or manually upload source maps, you will need to disable the automatic source map upload script. Learn more in the Disable the automatic source maps upload script documentation.

For more information on the release and dist parameters, check out the section on Source Maps.

We recommend using the format ${BUNDLE_ID}@${APP_VERSION}+codepush:${DIST} for release names.

import { release, dist } from "app.json";

  // ...

If you need to use codePush.getUpdateMetadata, you will have to wait to initialize the Sentry SDK until the Promise is resolved.

import codePush from "react-native-code-push";

codePush.getUpdateMetadata().then((update) => {
  if (update) {
      // ...
      release: `${update.appVersion}+codepush:${update.label}`,
      dist: update.label,

If you're wrapping your root component with Sentry.wrap to access Performance features, codePush should be the outer most function because it needs access to the root component in order to swap out the bundle.

export default codePush(Sentry.wrap(App));

Making Releases

After updating your CodePush release, you have to upload the new assets to Sentry:

When making the release with CodePush, make sure to output the bundle and source maps by specifying --sourcemap-output and --output-dir ./build. This will output to the ./build/CodePush folder.

appcenter codepush release-react -a {APP} -d {DEPLOYMENT} --sourcemap-output --output-dir ./build

Exporting the SENTRY_PROPERTIES will tell sentry-cli to use the properties in your

projectRepresents your service in Sentry and allows you to scope events to a distinct application.
. The sentry-wizard install step should have generated this file for you. Alternatively, you can either pass it via parameters or a global settings file. To find more about this refer to Working with Projects.


Upload the outputted bundle and source maps to Sentry. If you use custom deployment names in CodePush, you will need to use --deployment to specify the deployment.

sentry-cli react-native appcenter {APP} ios ./build/CodePush --deployment {DEPLOYMENT} --dist {DIST}

For non-macOS devices building for iOS, you will need to pass extra parameters that can't be computed automatically (--bundle-id and --version-name). Within your Info.plist, --version-name corresponds to CFBundleShortVersionString .

On iOS:

sentry-cli react-native appcenter {APP} ios ./build/CodePush --deployment {DEPLOYMENT} --dist {DIST} --bundle-id {BUNDLE_ID} --version-name {VERSION_NAME}

If you don't want to use the automatically computed release format, instead of passing --bundle-id and --version-name, you'll need to pass the --release-name parameter.

sentry-cli react-native appcenter {APP} ios ./build/CodePush --deployment {DEPLOYMENT} --dist {DIST} --release-name {RELEASE_NAME}

If you still have issues with CodePush source maps, you can refer to Source Maps for Other Platforms to manually bundle and upload source maps to Sentry.

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