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

@daffodilsw/react-native-codepush

v1.0.26

Published

Custom CodePush Handler

Readme

@daffodilsw/react-native-codepush

A lightweight OTA (Over-The-Air) update system for React Native, allowing you to update your JavaScript bundle instantly without publishing a new version to the Play Store or App Store.

This library supports:

  • Android and iOS both platform

  • S3/HTTPS bundle hosting

  • Zero AppCenter dependency

  • Customizable update modal

🛠 Getting Started

Note: This library assumes you already have a working React Native environment.

If not, follow the official guide: https://reactnative.dev/docs/set-up-your-environment

📦 Installation

Install the module using npm or yarn:

npm

npm install @daffodilsw/react-native-codepush

yarn

yarn add @daffodilsw/react-native-codepush

iOS Setup

  • From your iOS folder, install CocoaPods: cd ios pod install

🚀 Usage

Import the component:

import CodePushUpdateAlert from '@daffodilsw/react-native-codepush';

otaConfig = {
   otaVersion: 1, 
    immediate: true/false, // set true if you want to reflect changes immediately.
    content: {
      "title": "Update Popup Title",  
      "description": "Update Popup Description"
    },
    BUNDLE_URL: CODEPUSH_URL,  // this should be public url of your bundle directory. https://your-bucket/ota/
    button: {
        download: "Download Update",
        downloading:'Downloading',
        installing: 'Installing',
        relaunching:'Relaunching',
    },
}

  if (otaConfig?.otaVersion && otaConfig?.otaVersion > 0) {
    return <CodePushUpdateAlert otaConfig={otaConfig} />;
  }

📘 How OTA Works

If a newer OTA version exists:

  • Downloads bundle ZIP from CODEPUSH_URL
  • Extracts JS bundle + assets
  • Saves them in local storage
  • Restarts the app using native module
  • React Native loads the new bundle on next launch

📁 Generating OTA Bundles

  • Follow these steps every time you want to release a new JS-only OTA update.

1️⃣ Generate Android Bundle:

npx react-native bundle \
  --platform android \
  --dev false \
  --entry-file index.js \
  --bundle-output ./codepush/android/ota/index.android.bundle \
  --assets-dest ./codepush/android/ota

  A folder will be created:
  - codepush/android/ota/
  - ├── index.android.bundle
  - └── drawable-xxxx/ 
  - └── raw/ 

2️⃣ Generate iOS Bundle:

npx react-native bundle \
  --platform ios \
  --dev false \
  --entry-file index.js \
  --bundle-output ./codepush/ios/ota/main.jsbundle \
  --assets-dest ./codepush/ios/ota

  A folder will be created:
  - codepush/ios/ota/
  - ├── main.jsbundle
  - └── assets/

3️⃣ Prepare ZIP/Bundle Files

Please zip only the OTA folder and ensure the bundle file follows the correct naming convention.

Android:

  • android-{versionName}-{otaVersion}.zip -> android-1.0.1-1.zip

iOS:

  • ios-{versionName}-{otaVersion}.zip -> ios-1.0-1.zip

Upload bundle to public bucket:

Upload the ZIP file to your public bucket at: // https://your-bucket/ota/filename.zip Example:

  • android:
    • https://your-bucket/ota/android-1.0.1-1.zip
  • ios:
    • https://your-bucket/ota/ios-1.1-1.zip

Serve new bundle on relaunch

Anroid:

Update/add getJsbundleFile override method in MainApplication.kt

import com.skcodepush.CodePushModule

   override fun getJSBundleFile(): String? {
        val path = CodePushModule.getBundlePathIfExistsSync(applicationContext)
        return path ?: super.getJSBundleFile();
    }

IOS:

Update/add bundleURL override method in AppDelegate.swift

// update bundleURL() in AppDelegate.swift

  override func bundleURL() -> URL? {

  # check custom bundle
    if let customPath = CodePush.getBundlePathIfExistsSync() {
      return URL(fileURLWithPath: customPath)
    }
    
    #if DEBUG
      return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
    #else
      return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
    #endif
  }

update:
project_name-Bridging-Header.h
#import "CodePush.h"