Skip to main content

SDK Overview

The SwiftPatch SDK pushes over-the-air updates to your React Native app -- no app store review required. Install it, wrap your root component, and deploy from the CLI. Your users get changes in seconds.

What is an OTA update?

An OTA update replaces your app's JavaScript bundle at runtime. Native code changes still require an app store release. The SDK handles downloading, verifying, and applying bundle updates automatically.

Get Started in 3 Steps

Step 1: Install

npm install @swiftpatch/react-native

Step 2: Wrap Your Root Component

import { withSwiftPatch } from '@swiftpatch/react-native';

function App() {
return <YourApp />;
}

export default withSwiftPatch(App);

Step 3: Deploy

swiftpatch deploy -p ios --hermes

That's it! Your app now checks for updates on every launch and resume, downloads them in the background, and applies them on the next restart.

Zero config by default

The SDK reads credentials from native config files. You do not need to pass options to withSwiftPatch unless you want to customize behavior.

How It Works

┌─────────────────────┐         ┌──────────────────────┐
│ Your React Native │ │ SwiftPatch API │
│ App │────────>│ api.swiftpatch.io │
│ │ check │ │
│ ┌───────────────┐ │ └──────────────────────┘
│ │ SwiftPatch SDK│ │ │
│ │ │ │ │ manifest
│ │ - Check │ │ v
│ │ - Download │ │ ┌──────────────────────┐
│ │ - Verify │<─────────│ SwiftPatch CDN │
│ │ - Install │ │ bundle │ cdn.swiftpatch.io │
│ │ - Stabilize │ │ └──────────────────────┘
│ └───────────────┘ │
└─────────────────────┘

Update Lifecycle

  1. Check -- Query the API on launch and resume for new deployments.
  2. Download -- Fetch the bundle from CDN. Uses differential patches (bsdiff) when possible, reducing size by 10-50x.
  3. Verify -- Validate with SHA-256 (a cryptographic function that creates a unique fingerprint for any file) hash. Optionally verify JWT (JSON Web Token -- a compact, signed data format) RS256 signature.
  4. Install -- Stage the bundle for activation (immediately or on next restart).
  5. Stabilize -- After 2 successful launches, promote to "stable" status.
  6. Rollback -- If a crash is detected before stabilization, revert automatically.

Key Features

  • Automatic updates -- Checks on every launch and resume. Customizable via Configuration.
  • Crash detection and rollback -- Automatically reverts to the last stable version if the new bundle crashes.
  • Differential patches -- Downloads only what changed. Updates are 10-50x smaller than the full bundle.
  • Hermes bytecode -- Works with precompiled Hermes (React Native's JavaScript engine that runs precompiled bytecode) bundles on both platforms.
  • New Architecture -- Full TurboModules (faster native module communication, replacing the old bridge) and Fabric (React Native's new rendering engine for smoother UI) support. Auto-detects at runtime.
  • Code signing -- Optional RSA (a widely used encryption algorithm that uses a pair of keys: a private key to sign and a public key to verify) signing to verify updates have not been tampered with.
TypeScript included

The SDK ships with full TypeScript definitions for all options, hooks, methods, and types.

Package Info

PropertyValue
Package@swiftpatch/react-native
Version2.1.8
React Native>= 0.76.0
React>= 18.2.0
iOS>= 13.4
AndroidSDK 24+ (Android 7.0+)
Node.js>= 18.0.0
LicenseMIT

Next Steps

PageWhat you find
InstallationStep-by-step setup for iOS and Android
ConfigurationAll SDK options -- install modes, check frequency, code signing
HooksReact hooks: useSwiftPatch, useSwiftPatchUpdate, useSwiftPatchModal
MethodsImperative API for manual update control
Where to start

Adding SwiftPatch to an existing app? Start with Installation. Already installed? Jump to Configuration.