Can I use a separate CodePush environment for staging?

Last updated: August 6, 2026

Context

You may want to test updates or experiments in a staging environment without affecting your production CodePush users. Rather than setting up a separate CodePush instance, CodePush has this concept built in through deployments.

Answer

Every app registered in CodePush automatically gets two deployment channels: Staging and Production. Each channel is independent and has its own deployment key, so you can release updates to Staging without affecting any production users.

Here's how to set it up:

  1. Find your deployment keys

    Run the following command for each app (typically one for iOS and one for Android). The -k flag is required, as keys are hidden by default.

    code-push deployment ls <your-app-name> -k
  2. Point your non-production build at the Staging key

    Set CodePushDeploymentKey to the Staging key in Info.plist (iOS) or strings.xml (Android). If you have multiple build variants or schemes, it is recommended to configure the key per variant or inject it as an environment variable at build time, rather than hardcoding a single value. This allows your debug and release builds to coexist without manual swapping. For exact code snippets, refer to the Add CodePush to a React Native app section of the documentation.

  3. Release your updates to Staging

    code-push release-react <your-app-name> ios -d Staging

    Production users are unaffected, since their installed binary carries the Production key and only queries that channel.

  4. Promote to Production when ready

    code-push promote <your-app-name> Staging Production

For more details on setting up deployments, see the CodePush Setup page in the documentation.