React Native OTA Bundler CLI

raw JSON →
1.0.15 verified Thu Apr 23 auth: no javascript

rn-ota-bundler is a command-line interface (CLI) tool designed to streamline Over-The-Air (OTA) updates for React Native applications that utilize a multi-bundle architecture. It provides a comprehensive suite of commands to bundle, optionally obfuscate using `javascript-obfuscator`, zip, and manage React Native modules, then upload them to a remote server for distribution. The current stable version is 1.0.15. While a specific release cadence isn't published, the tool appears actively maintained as a solution for modern React Native development. Key differentiators include its end-to-end CLI workflow for managing the entire OTA lifecycle, from local bundling and obfuscation to server interaction for authentication, module/variant management, and release deployment, catering specifically to multi-bundle React Native setups. It simplifies version detection for both Android and iOS platforms by parsing `build.gradle` or `Info.plist`/`project.pbxproj` and integrates optional JavaScript obfuscation for deployed bundles.

error Error: Command not found: rn-ota-bundler
cause The `rn-ota-bundler` command was not found in your system's PATH, or `npx` couldn't locate it.
fix
Ensure you are running the command using npx (e.g., npx rn-ota-bundler login) or that the package is globally installed if you intend to use it without npx (npm install -g rn-ota-bundler).
error Error: Module '<module_name>' not found. Please add it first.
cause You attempted to bundle or release a module that has not been registered with the OTA system.
fix
Register the module first using the modules --add command: npx rn-ota-bundler modules --add <module_name>.
error Error: Not authenticated. Please login first.
cause You tried to execute a command that requires authentication with the OTA server without having logged in.
fix
Run npx rn-ota-bundler login to authenticate and save your JWT token locally before attempting server-interacting commands like release or bundles.
error Error: Missing required option: --module <name>
cause You executed a command like `bundle` or `release` that requires a specific module name but did not provide it.
fix
Always provide the module name using the -m or --module option. For example: npx rn-ota-bundler bundle -m homepage -p android.
gotcha The CLI expects a specific project structure, including `src/<module_name>/index.js` as the entry point for modules and standard React Native `android/` and `ios/` directories for app version detection. Deviations can lead to bundling failures or incorrect versioning.
fix Ensure your project adheres to the expected structure. Module entry points should be `src/<module_name>/index.js`. Standard `android/` and `ios/` folders are required for automatic version detection.
gotcha By default, the CLI attempts to connect to an OTA server at `http://localhost:3000`. For production use, or if your server is elsewhere, this default must be overridden by modifying `src/default-config.json` before building the tool, or through environment variables/configuration if available.
fix Modify the `src/default-config.json` file in the package's source to point to your desired server URL before building/using for non-local environments. Consult package documentation for potential runtime configuration options.
gotcha Obfuscation, when enabled with the `--obfuscate` flag, relies on the presence of an `obfuscator.config.json` file in the root directory of your project. If this file is missing, obfuscation will not be applied, even if the flag is set.
fix To enable obfuscation, ensure `javascript-obfuscator` is installed as a dev dependency (`npm install -D javascript-obfuscator`) and a valid `obfuscator.config.json` file exists in your project's root directory, configured with your desired obfuscation settings.
gotcha Commands such as `release`, `bundles`, `history`, and `edit-bundle` that interact with the remote OTA server require prior authentication. Failure to log in will result in authorization errors.
fix Always run `npx rn-ota-bundler login` first to authenticate with the OTA server before attempting commands that require server interaction. Ensure your server is running and accessible.
npm install rn-ota-bundler
yarn add rn-ota-bundler
pnpm add rn-ota-bundler

This quickstart demonstrates the core workflow of `rn-ota-bundler`: authenticating, setting up modules and environments, locally bundling with optional obfuscation, releasing (bundling and uploading) to a server, listing bundles, and managing bundle properties post-release via CLI commands.

// First, install the CLI tool as a dev dependency
npm install -D rn-ota-bundler

// Login to the OTA server. By default, it attempts to connect to http://localhost:3000.
// This command opens a browser for authentication and saves the JWT token locally.
npx rn-ota-bundler login

// Add a new module named 'myAppModule'. This registers it with the OTA system.
npx rn-ota-bundler modules --add myAppModule

// Add a new environment/variant named 'staging' for organizing releases.
npx rn-ota-bundler variants --add staging

// Add a local app version '1.0.0' for tracking compatibility with bundles.
npx rn-ota-bundler versions --add 1.0.0

// Bundle the 'myAppModule' for the Android platform, enabling obfuscation.
// For obfuscation to take effect, an 'obfuscator.config.json' file must be present in your project's root directory.
npx rn-ota-bundler bundle -m myAppModule -p android --obfuscate

// Release (bundle and upload) the 'myAppModule' for the iOS platform to the configured server.
// This command performs bundling and then uploads the generated zip file.
npx rn-ota-bundler release -m myAppModule -p ios

// List all remote bundles that have been uploaded.
npx rn-ota-bundler bundles

// Edit properties of a previously released bundle (e.g., bundle ID '123').
// Here, we activate the bundle and set its minimum compatible app version.
npx rn-ota-bundler edit-bundle 123 --active true --min-app 1.0.0