Skip to content

hasangonen91/react-native-livepatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🩹 LivePatch

npm version license

CodePush is dead. This is the free replacement.

Push JavaScript updates to your React Native app instantly. No rebuild, no app store review, no cloud dependency.

CodePush shut down. Now what?

Microsoft killed CodePush in March 2025. Your options:

Solution Cost Self-hosted Bare RN No account
CodePush Dead β€” β€” β€”
EAS Update Paid tiers ❌ ⚠️ needs Expo ❌
Shorebird Paid ❌ Limited ❌
LivePatch Free βœ… βœ… βœ…

Install

yarn add react-native-livepatch

Quick Start

1. In your app (2 lines):

import { LivePatch } from 'react-native-livepatch';

LivePatch.configure({
  updateUrl: 'https://your-server.com/updates',
  channel: 'production',
});

App checks for updates on launch. If available, downloads and applies automatically.

2. Push an update (1 command):

npx livepatch push --upload github

Done. All users get the update on next app open.

How It Works

You change code β†’ livepatch push β†’ users open app β†’ new code running
                                    (no store update needed)
  1. livepatch push bundles your JS and uploads to hosting
  2. App launches β†’ checks update server β†’ downloads new bundle
  3. App restarts with new code β€” instant, seamless

Upload Options

livepatch push --upload github      # GitHub Releases (free, unlimited)
livepatch push --upload vercel      # Vercel (free tier)
livepatch push --upload https://s3.amazonaws.com/my-bucket  # Any server
livepatch push                      # Bundle only (upload manually)

No paid service needed. GitHub Releases is free and handles unlimited downloads.

Commands

livepatch push                          # Bundle + prepare update
livepatch push --upload github          # Bundle + publish to GitHub
livepatch push --channel staging        # Push to staging channel
livepatch push --platform android       # Android only
livepatch serve                         # Local dev server (testing)
livepatch history                       # Show push history

Features

  • Free forever β€” no paid tiers, no limits, no accounts
  • Self-hosted β€” GitHub Releases, Vercel, S3, any static host
  • TypeScript β€” full type definitions included
  • Native modules β€” Android (Kotlin) + iOS (Swift)
  • Channel-based β€” push different updates to dev/staging/production
  • Integrity verification β€” SHA-256 hash check on every bundle
  • Rollback β€” revert to previous version instantly
  • Tiny β€” 13 KB package size, no heavy dependencies
  • Works offline β€” app functions normally without updates
  • Auto-apply β€” or manual control, your choice

Native Integration

Android (MainApplication.kt):

import com.livepatch.LivePatchModule

// In getDefaultReactHost:
jsBundleFilePath = LivePatchModule.getCustomBundlePath(this@MainApplication)

iOS (AppDelegate.swift):

import LivePatchModule

// In sourceURL:
return LivePatchModule.bundleURL() ?? Bundle.main.url(forResource: "main", withExtension: "jsbundle")

API

import { LivePatch } from 'react-native-livepatch';

// Configure (once on startup)
LivePatch.configure({ updateUrl: '...', channel: 'production' });

// Manual control
const update = await LivePatch.checkForUpdate();
// β†’ { available: true, version: '2026.6.5', size: 983040 }

await LivePatch.download((percent) => console.log(percent + '%'));
LivePatch.apply({ immediate: true }); // restart with new bundle

// Rollback
await LivePatch.rollback();

// Sync (check + download + apply in one call)
await LivePatch.sync();

Security

  • Bundle integrity verified with SHA-256 hash before applying
  • HTTPS enforced for production update URLs
  • Rollback on crash detection (if app crashes after update, reverts automatically)
  • No code execution from untrusted sources β€” only signed bundles

Store Compliance

  • Google Play βœ… β€” allows JS/asset updates without review (no native code changes)
  • Apple App Store βœ… β€” same policy, CodePush used this for years without issues

The rule: you can update JavaScript and assets, but not native code or app purpose.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Your App                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  LivePatch SDK (JS)                        β”‚  β”‚
β”‚  β”‚  - Check for updates                       β”‚  β”‚
β”‚  β”‚  - Download bundle                         β”‚  β”‚
β”‚  β”‚  - Trigger restart                         β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                β”‚                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Native Module (Kotlin/Swift)              β”‚  β”‚
β”‚  β”‚  - Store bundle on filesystem              β”‚  β”‚
β”‚  β”‚  - Override bundle path on next launch     β”‚  β”‚
β”‚  β”‚  - Restart app                             β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Update Server       β”‚
β”‚  (GitHub / Vercel /  β”‚
β”‚   S3 / your server)  β”‚
β”‚                      β”‚
β”‚  manifest.json       β”‚
β”‚  android.jsbundle    β”‚
β”‚  ios.jsbundle        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

License

MIT

Author

Hasan GΓΆnen β€” @hasangonen91


Also check out react-native-starship β€” wireless deploy for React Native (QR scan β†’ install β†’ running).

About

Free, self-hosted OTA updates for React Native. CodePush alternative.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors