{"id":17932,"library":"rn-ota-bundler","title":"React Native OTA Bundler CLI","description":"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.","status":"active","version":"1.0.15","language":"javascript","source_language":"en","source_url":"https://github.com/ariefmanda/rn-ota-bundler","tags":["javascript","react-native","ota","bundle","typescript"],"install":[{"cmd":"npm install rn-ota-bundler","lang":"bash","label":"npm"},{"cmd":"yarn add rn-ota-bundler","lang":"bash","label":"yarn"},{"cmd":"pnpm add rn-ota-bundler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for bundle obfuscation if `--obfuscate` option is used and `obfuscator.config.json` is present.","package":"javascript-obfuscator","optional":true}],"imports":[{"note":"This package is a command-line interface (CLI) tool. Its functionality is accessed by executing `npx rn-ota-bundler` followed by specific commands and options. It does not expose a programmatic API for direct JavaScript/TypeScript `import` or `require` usage.","wrong":"const rnOtaBundler = require('rn-ota-bundler');","symbol":"CLI Execution","correct":"npx rn-ota-bundler <command> [options]"},{"note":"Attempting to import named exports for functions like `bundle` or `release` will fail as the package is designed solely as a command-line interface and does not provide such functions programmatically.","wrong":"import { bundle, release } from 'rn-ota-bundler';","symbol":"Named Exports (N/A)","correct":"(N/A)"},{"note":"There is no default export from this package. It is intended to be used via its CLI commands, not as a standard JavaScript module with default exports.","wrong":"import rnOtaBundler from 'rn-ota-bundler';","symbol":"Default Export (N/A)","correct":"(N/A)"}],"quickstart":{"code":"// First, install the CLI tool as a dev dependency\nnpm install -D rn-ota-bundler\n\n// Login to the OTA server. By default, it attempts to connect to http://localhost:3000.\n// This command opens a browser for authentication and saves the JWT token locally.\nnpx rn-ota-bundler login\n\n// Add a new module named 'myAppModule'. This registers it with the OTA system.\nnpx rn-ota-bundler modules --add myAppModule\n\n// Add a new environment/variant named 'staging' for organizing releases.\nnpx rn-ota-bundler variants --add staging\n\n// Add a local app version '1.0.0' for tracking compatibility with bundles.\nnpx rn-ota-bundler versions --add 1.0.0\n\n// Bundle the 'myAppModule' for the Android platform, enabling obfuscation.\n// For obfuscation to take effect, an 'obfuscator.config.json' file must be present in your project's root directory.\nnpx rn-ota-bundler bundle -m myAppModule -p android --obfuscate\n\n// Release (bundle and upload) the 'myAppModule' for the iOS platform to the configured server.\n// This command performs bundling and then uploads the generated zip file.\nnpx rn-ota-bundler release -m myAppModule -p ios\n\n// List all remote bundles that have been uploaded.\nnpx rn-ota-bundler bundles\n\n// Edit properties of a previously released bundle (e.g., bundle ID '123').\n// Here, we activate the bundle and set its minimum compatible app version.\nnpx rn-ota-bundler edit-bundle 123 --active true --min-app 1.0.0","lang":"javascript","description":"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."},"warnings":[{"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.","message":"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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"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`).","cause":"The `rn-ota-bundler` command was not found in your system's PATH, or `npx` couldn't locate it.","error":"Error: Command not found: rn-ota-bundler"},{"fix":"Register the module first using the `modules --add` command: `npx rn-ota-bundler modules --add <module_name>`.","cause":"You attempted to bundle or release a module that has not been registered with the OTA system.","error":"Error: Module '<module_name>' not found. Please add it first."},{"fix":"Run `npx rn-ota-bundler login` to authenticate and save your JWT token locally before attempting server-interacting commands like `release` or `bundles`.","cause":"You tried to execute a command that requires authentication with the OTA server without having logged in.","error":"Error: Not authenticated. Please login first."},{"fix":"Always provide the module name using the `-m` or `--module` option. For example: `npx rn-ota-bundler bundle -m homepage -p android`.","cause":"You executed a command like `bundle` or `release` that requires a specific module name but did not provide it.","error":"Error: Missing required option: --module <name>"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}