Skip to content

About

HotCodePush Capacitor live updates: the Capacitor plugin that delivers over-the-air updates to your app, @hotcodepush/capacitor-live-updates on npm

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

143 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Capacitor live updates by HotCodePush

npm CI License

@hotcodepush/capacitor-live-updates is the Capacitor plugin that delivers over-the-air (OTA) updates to your app. Ship a web build fix with one command, reach every installed app within seconds, and roll it back from the console if something goes wrong. No store review, no new build. Learn more at hotcodepush.com/capacitor-live-updates.

Ship updates in seconds. Over-the-air updates for React Native, Expo, Capacitor and Cordova. Get started.

Features

  • ⚑️ One command to release. npm run build && npx hotcodepush release create uploads, signs and publishes your web build for both platforms.
  • πŸ“Ί Channels. Staging, beta and production, each with its own release log, and promotion between them.
  • πŸš€ Staged rollouts. Start at 5 percent, widen in steps, and let the automatic pause stop a release that fails on devices.
  • πŸ›Ÿ Rollback. One command or one click sends every device back to the release before.
  • πŸ” Delta updates. A device downloads what changed, built on the platform from the bundle it runs.
  • πŸ”’ Code signing. The app runs only bundles signed with your key, which never leaves your machine or your CI.
  • 🎯 Conditions. Target a release by binary version, OS version, device attributes or a list of devices.
  • πŸ–₯️ Console, CLI and GitHub Action. Watch devices arrive on a release in the console, release from the terminal, or from a workflow step.
  • πŸ€– Built for agents. An MCP server and agent skills let Claude Code or Cursor set up, release and debug for you.
  • 🌐 Open source. The plugin, the CLI, the clients and the Action are MIT licensed.

Compatibility

Plugin Capacitor iOS Android
0.x 8 and 7 15 and later 6.0 (API 23) and later

Demo

capacitor-live-updates-demo is a Capacitor app with the plugin wired in, built on both platforms and released through the GitHub Action on every merge.

Guides

Installation

AI-assisted setup (recommended)

Paste this prompt into the agent or assistant you use:

Set up HotCodePush OTA updates in this project, following https://hotcodepush.com/docs/quickstart.md. If you can run commands, install the agent skills with `npx skills add hotcodepush-team/skills`, then run hotcodepush-init and hotcodepush-release. If you cannot run commands, read that page and give me the steps to do it myself.

An agent that runs commands installs the plugin, creates the app and the channel, and ships the first update. An assistant without a shell reads the quickstart and hands you the steps. Agent skills explains what the agent does.

Set up with the CLI

npx hotcodepush init

init signs you in, picks or creates the app, installs the plugin, writes hotcodepush.json, adds the import to your entry file, wires the build step into both native projects and offers a signing key. Build the app once in release, an Xcode archive or a Gradle release variant, so the store build registers itself. Then change something and ship it:

npm run build && npx hotcodepush release create

The installed app downloads the release at its next start and runs it from the start after that.

Prefer to wire it yourself? The installation guide has the steps by hand: the package and npx cap sync, hotcodepush.json, the import, the Xcode phase and the Gradle line, and the check with doctor.

Usage

Sync and read the result

With the default checkStrategy of auto, the SDK checks on start, on resume and in the foreground, and sync() runs one cycle on demand. Applying an update reloads the app's web view.

import { HotCodePush } from '@hotcodepush/capacitor-live-updates';

const result = await HotCodePush.sync();
if (result.status === 'downloaded') {
  console.log(
    `release #${result.release.number} applies at ${result.applyStrategy}`,
  );
}

Import the package in the app's entry file: the import tells the SDK the app rendered, and an app that never imports it rolls every update back.

Show your users what is happening

Five events follow a cycle, so a badge, a progress bar or a restart prompt is a listener each:

await HotCodePush.addListener('updateAvailable', ({ release }) =>
  showBadge(release.bundleVersion),
);
await HotCodePush.addListener('downloadProgress', ({ progress }) =>
  showProgress(progress),
);
await HotCodePush.addListener('updateDownloaded', () =>
  askToRestart(() => HotCodePush.applyUpdate()),
);

Decide when an update lands

Set downloadStrategy and applyStrategy to manual in hotcodepush.json, then download and apply at the moments you choose, and hold the SDK's own restarts while a flow must not be interrupted:

await HotCodePush.setRestartAllowed({ isAllowed: false });
await HotCodePush.downloadUpdate();
await HotCodePush.setRestartAllowed({ isAllowed: true });
await HotCodePush.applyUpdate();

A release that never renders is rolled back on its own, and rollbackUpdate() does the same on your call, so nothing above is needed for safety.

Target the right devices

A release with an --attribute plan=enterprise condition reaches the devices that carry the attribute, and a beta switch in your settings screen is one call. The channel sticks until the app clears it with setChannel(null):

await HotCodePush.setAttributes({
  attributes: { plan: 'enterprise', userId: '42' },
});
await HotCodePush.setChannel({ name: 'beta' });

See why a device did not update

The debug screen shows the device id, the channel, the binary and the result of the last check, the first stop for a device that did not update. getState() gives the same to your own diagnostics:

await HotCodePush.showDebugScreen();
const { currentRelease, lastCheck } = await HotCodePush.getState();

Documentation

See hotcodepush.com/docs/sdks/capacitor for the configuration, methods, events, types and reasons.

Development

See CLAUDE.md for the layout and the commands, and CONTRIBUTING.md for the rules of a change. The native cores live in core-ios and core-android.

License

See LICENSE. An app that ships the plugin also ships the native cores' third-party code: FreeBSD's bspatch (BSD 2-clause) on both platforms and bzip2 1.0.8 on Android. Reproduce the notices from core-ios and core-android in your app's distribution.

About

HotCodePush Capacitor live updates: the Capacitor plugin that delivers over-the-air updates to your app, @hotcodepush/capacitor-live-updates on npm

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages