Installation
React Native Stallion installation guide - Get started with OTA updates in 5 easy steps. Install SDK and CLI for React Native apps. Complete setup instructions.
Setting up React Native Stallion is straight forward, just install the CLI and SDK and start using. React Native Stallion requires react-native version 0.69 or higher for optimal performance.
SDK Installation
To get started, install the SDK using npm or yarn.
Step 1: Install the React Native Stallion SDK and CLI
Begin by installing SDK in your react-native project:
npm i react-native-stallion
or if you are using yarn then
yarn add react-native-stallion
for steps to install the CLI checkout CLI Installation Docs
Step 2: Native Installation
After installing the SDK, you need to install pods for iOS and gradle sync android project:
npx pod-install
Step 3: Add Stallion bundle support in Android and iOS projects
-
Android - Inside
MainApplication.java, override and implementgetJSBundleFilemethod :MainApplication.java// ...other imports import com.stallion.Stallion; public class MainApplication extends Application implements ReactApplication { // ...rest of the class @Override protected String getJSBundleFile() { return Stallion.getJSBundleFile(getApplicationContext()); } }If running on latest version of react-native (>v0.76)
InsideMainApplication.ktfile edit thereactNativeHostmethod:MainApplication.kt// ...other imports import com.stallion.Stallion // ...other functions override val reactNativeHost: ReactNativeHost = object : DefaultReactNativeHost(this) { override fun getPackages(): List<ReactPackage> = //other methods... override fun getJSBundleFile(): String? { return Stallion.getJSBundleFile(applicationContext) } }If running on React Native 82 and above
InsideMainApplication.ktfile, override thereactHostproperty:MainApplication.kt// ...other imports import com.facebook.react.ReactHost import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost import com.stallion.Stallion class MainApplication : Application(), ReactApplication { override val reactHost: ReactHost by lazy { getDefaultReactHost( context = applicationContext, packageList = PackageList(this).packages, jsBundleFilePath = Stallion.getJSBundleFile(applicationContext) ) } } -
iOS - Inside
ios/AppDelegate.mmfile editbundleURLmethod// ...other imports #import "StallionModule.h" @implementation AppDelegate // ...other implemetations - (NSURL *)bundleURL { #if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; #else return [StallionModule getBundleURL]; #endif }If running on latest version of react-native (>v0.76)
Insideios/AppDelegate.swiftfile edit thebundleURLmethod:// ...other imports import react_native_stallion // ...other functions override func bundleURL() -> URL? { #if DEBUG RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") #else StallionModule.getBundleURL() #endif }
Step 4: Add ProjectId & AppToken in native
-
Get projectID from Stallion Dashboard : On project info page, copy project id.

-
Generate App Token : Navigate to
Project > Project Settings > Access Tokens, and selectGenerateorRegenerate AppToken to create a new token.
Add StallionProjectId & StallionAppToken as shown below -
-
iOS: Add the copied App Token and projectId to
info.plist<plist version="1.0"> <dict> <!-- ...other configs... --> <key>StallionProjectId</key> <string>66ed03380eb95c9c316256d3</string> <!-- make sure app token starts with spb_... and is 46 characters long --> <key>StallionAppToken</key> <string>spb_FTLx5umZgKLTEyiMNf9-81BgANTOvx7pNhA-gFXbg9</string> <!-- ...other configs... --> </dict> </plist>
-
android: Add the copied App Token and projectId to
strings.xml<resources> <string name="app_name">my_app</string> <!-- make sure app token starts with spb_... and is 46 characters long --> <string name="StallionProjectId">66ed03380eb95c9c316256d3</string> <string name="StallionAppToken">spb_FTLx5umZgKLTEyiMNf9-81BgANTOvx7pNhA-gFXbg9</string> </resources>
Step 5: Import and add Stallion as HOC in App.js
- Import
withStallionHOCimport { withStallion } from 'react-native-stallion'; - Wrap root component (generally App.tsx or App.js) with HOC
export default withStallion(App)
With this setup, you’ll have installed Stallion. I next section we will see how to use Stallion to deploy bundles and get realtime updates.
Remember:
After installing Stallion in your React Native app, make sure to publish a build (APK or TestFlight) with Stallion fully integrated. This is essential to test and verify that OTA updates are being correctly installed via Stallion. Note: If you're running your app in development mode connected to the Metro bundler, Stallion's OTA changes will not be applied. To properly test OTA updates, you must use a published app build.