npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-push-cli

v1.0.3

Published

CLI tool for building and publishing React Native bundles to ReactPush

Readme

ReactPush CLI

Command-line tool for building and publishing React Native and Flutter bundles to ReactPush.

Supported Frameworks

| Framework | Build Tool | Platforms | |-----------|-----------|-----------| | React Native | Metro Bundler | iOS, Android | | Flutter | Flutter CLI | iOS, Android, Web |

Installation

npm install
npm link  # Makes the CLI available globally as 'react-push'

Or use directly with npx:

npx react-push-cli <command>

Configuration

You can configure the CLI to avoid entering API key and URL every time. The CLI supports multiple ways to provide configuration:

Option 1: Configuration File (Recommended)

Initialize configuration once per project:

react-push init --api-key YOUR_APP_API_KEY

Or with a custom API URL:

react-push init --api-key YOUR_APP_API_KEY --api-url https://api.example.com

This creates a .reactpushrc file in your project root. After initialization, you can use publish without specifying API key/URL:

react-push publish --version 1.0.1 --bundle-url https://cdn.example.com/bundles/1.0.1/bundle.js

Option 2: API Key File

Store your API key in a file and reference it:

# Create a file with your API key
echo "YOUR_API_KEY" > .api-key

# Use it with --api-key-file
react-push publish --api-key-file .api-key --version 1.0.1 ...

Option 3: Environment Variables

Create a .env file in your project root:

REACTPUSH_API_KEY=YOUR_API_KEY
REACTPUSH_API_URL=https://api.example.com

The CLI will automatically read from .env if no other source is provided.

Option 4: Command Line Options

You can still provide API key and URL directly via command line (overrides config):

react-push publish --api-key YOUR_KEY --api-url https://api.example.com --version 1.0.1 ...

Default API URL

If no API URL is provided, the CLI defaults to http://localhost:5000. You can override this in:

  • Configuration file (via init)
  • Command line (--api-url)
  • Environment variable (REACTPUSH_API_URL)

React Native Usage

Publish Update (React Native)

Build and publish a React Native bundle update:

react-push publish \
  --framework react-native \
  --version 1.0.1 \
  --platform ios \
  --bundle-url https://cdn.example.com/bundles/1.0.1/bundle.js \
  --assets-url https://cdn.example.com/bundles/1.0.1/assets \
  --label "v1.0.1" \
  --description "Bug fixes and performance improvements" \
  --mandatory

React Native Options:

  • --framework: Set to react-native (default)
  • --version (required): Version number (e.g., 1.0.1)
  • --api-key: Your app's API key (optional if configured via init or config file)
  • --api-key-file: Path to file containing API key (optional)
  • --api-url: ReactPush API URL (optional, defaults to http://localhost:5000)
  • --platform: Platform (ios or android). If not specified, builds for both platforms.
  • --project-root: React Native project root directory, default: current directory
  • --entry-file: Entry file path, default: index.js
  • --bundle-url: Public URL for the bundle (if already uploaded). Use --bundle-url-ios and --bundle-url-android for both platforms.
  • --bundle-url-ios: Public URL for iOS bundle
  • --bundle-url-android: Public URL for Android bundle
  • --assets-url: Public URL for assets (if already uploaded). Use --assets-url-ios and --assets-url-android for both platforms.
  • --assets-url-ios: Public URL for iOS assets
  • --assets-url-android: Public URL for Android assets
  • --label: Release label, default: v{version}
  • --description: Release description
  • --mandatory: Mark update as mandatory
  • --dev: Build in development mode
  • --minify: Minify the bundle (default: true)
  • --sourcemap-output: Output path for source map

Build Only (React Native)

Build a bundle without publishing:

react-push build \
  --framework react-native \
  --platform ios \
  --bundle-output ./build/bundle.js \
  --assets-dest ./build/assets

Flutter Usage

Publish Update (Flutter)

Build and publish a Flutter bundle update:

react-push publish \
  --framework flutter \
  --version 1.0.1 \
  --platform ios \
  --app-id YOUR_APP_ID \
  --label "v1.0.1" \
  --description "Bug fixes and performance improvements" \
  --mandatory

Flutter Options:

  • --framework: Set to flutter
  • --version (required): Version number (e.g., 1.0.1)
  • --api-key: Your app's API key (optional if configured via init or config file)
  • --api-key-file: Path to file containing API key (optional)
  • --api-url: ReactPush API URL (optional, defaults to http://localhost:5000)
  • --app-id: App ID (required for zip upload)
  • --platform: Platform (ios, android, or web). If not specified, builds for iOS and Android.
  • --project-root: Flutter project root directory, default: current directory
  • --label: Release label, default: v{version}
  • --description: Release description
  • --mandatory: Mark update as mandatory
  • --flutter-build-mode: Build mode: release, profile, or debug (default: release)
  • --flutter-target: Flutter target file (default: lib/main.dart)
  • --flutter-flavor: Flutter flavor for the build
  • --dart-define: Dart compile-time defines (can be used multiple times)

Build Only (Flutter)

Build a Flutter bundle without publishing:

react-push build \
  --framework flutter \
  --platform ios \
  --bundle-output ./build/bundle.js \
  --assets-dest ./build/assets

Flutter Web Build

For Flutter web apps, use --platform web:

react-push publish \
  --framework flutter \
  --platform web \
  --version 1.0.1 \
  --app-id YOUR_APP_ID

Examples

Example 1: React Native - Using configuration file (recommended)

# First time: Initialize config
react-push init --api-key abc123xyz --api-url https://api.reactpush.com

# Then publish without API key/URL
react-push publish \
  --framework react-native \
  --version 1.0.2 \
  --platform android \
  --bundle-url https://cdn.example.com/bundles/1.0.2/bundle.js \
  --assets-url https://cdn.example.com/bundles/1.0.2/assets \
  --label "v1.0.2" \
  --description "New features and improvements"

Example 2: React Native - Build bundle first, then publish

# Step 1: Build the bundle
react-push build --framework react-native --platform ios --bundle-output ./build/bundle.js

# Step 2: Upload bundle.js and assets to your CDN
# (manual step or use your CDN's CLI)

# Step 3: Publish with URLs (using config file)
react-push publish \
  --framework react-native \
  --version 1.0.3 \
  --bundle-url https://cdn.example.com/bundles/1.0.3/bundle.js \
  --assets-url https://cdn.example.com/bundles/1.0.3/assets

Example 3: React Native - Build and publish in one command

react-push publish \
  --framework react-native \
  --version 1.0.4 \
  --platform ios \
  --bundle-output ./build/bundle-1.0.4.js \
  --assets-dest ./build/assets-1.0.4 \
  --bundle-url https://cdn.example.com/bundles/1.0.4/bundle.js \
  --assets-url https://cdn.example.com/bundles/1.0.4/assets

Example 4: React Native - Build for both platforms

# Build bundles for both iOS and Android
react-push build --framework react-native

# This creates:
# - ./build/bundle-ios.js
# - ./build/bundle-android.js
# - ./build/assets-ios/
# - ./build/assets-android/

Example 5: React Native - Publish for both platforms

# Publish updates for both platforms
react-push publish \
  --framework react-native \
  --version 1.0.7 \
  --bundle-url-ios https://cdn.example.com/bundles/1.0.7/ios/bundle.js \
  --bundle-url-android https://cdn.example.com/bundles/1.0.7/android/bundle.js \
  --assets-url-ios https://cdn.example.com/bundles/1.0.7/ios/assets \
  --assets-url-android https://cdn.example.com/bundles/1.0.7/android/assets

Example 6: Flutter - Build and publish for iOS

react-push publish \
  --framework flutter \
  --version 1.0.1 \
  --platform ios \
  --app-id YOUR_APP_ID \
  --flutter-build-mode release \
  --label "v1.0.1" \
  --description "Initial Flutter release"

Example 7: Flutter - Build for both platforms

react-push build --framework flutter

# This creates:
# - ./build/bundle-ios.js
# - ./build/bundle-android.js
# - ./build/assets-ios/
# - ./build/assets-android/

Example 8: Flutter - Publish with flavor and dart defines

react-push publish \
  --framework flutter \
  --version 1.0.2 \
  --platform android \
  --app-id YOUR_APP_ID \
  --flutter-flavor production \
  --dart-define "API_URL=https://api.prod.example.com" \
  --dart-define "DEBUG=false"

Example 9: Flutter Web - Build and publish

react-push publish \
  --framework flutter \
  --platform web \
  --version 1.0.1 \
  --app-id YOUR_APP_ID \
  --label "v1.0.1 Web"

Example 10: Package assets for upload

# Package assets into a zip file
react-push package \
  --assets-path ./build/assets-ios-1.0.8 \
  --output ./build/assets-1.0.8.zip

# Upload the zip to your CDN, extract it, then publish
react-push publish \
  --version 1.0.8 \
  --bundle-url https://cdn.example.com/bundles/1.0.8/bundle.js \
  --assets-url https://cdn.example.com/bundles/1.0.8/assets

Commands

init

Initialize configuration file for the project. Saves API key and URL so you don't need to enter them every time.

react-push init --api-key YOUR_API_KEY
react-push init --api-key-file .api-key --api-url https://api.example.com

publish

Build and publish a React Native or Flutter bundle update to ReactPush API.

build

Build a React Native or Flutter bundle without publishing. Useful for testing or manual upload workflows.

package

Package assets into a zip file for easier upload to CDN or file server.


Notes

React Native

  • The CLI uses Metro bundler to build React Native bundles
  • Assets are collected from common directories: assets/, src/assets/, images/, src/images/, and platform-specific directories
  • You need to upload bundles and assets to a publicly accessible URL (CDN or file server) before publishing
  • The API key should be your app's API key (not the tenant API key)
  • All bundle and asset URLs must be publicly accessible
  • The package command creates a zip file of assets that you can upload to your CDN and extract

Flutter

  • The CLI uses Flutter CLI to build bundles
  • For mobile platforms (iOS/Android), the CLI builds Flutter asset bundles
  • For web platform, the CLI builds the Flutter web output and packages main.dart.js
  • Flutter assets are collected from common directories: assets/, images/, fonts/, lib/assets/
  • Requires Flutter SDK to be installed and available in PATH

Troubleshooting

React Native Issues

Error: react-native CLI not found

  • Make sure you have react-native installed in your project
  • Run npm install react-native in your project directory

Error: Bundle URL is required

  • You need to provide --bundle-url with a publicly accessible URL
  • Upload your bundle to a CDN or file server first

Flutter Issues

Error: Flutter CLI not found

  • Make sure Flutter is installed and available in your PATH
  • Run flutter --version to verify installation
  • Visit https://flutter.dev/docs/get-started/install for installation instructions

Error: Flutter build failed

  • Run flutter doctor to check for any issues
  • Ensure all Flutter dependencies are installed
  • Try running flutter clean before building

General Issues

Error: API request failed

  • Check that your API key is correct
  • Verify the API URL is accessible
  • Ensure the bundle and asset URLs are publicly accessible