Cordova
The HotCodePush Cordova SDK, @hotcodepush/cordova-code-push, with the one-command setup, the first call and its reference pages.
@hotcodepush/cordova-code-push delivers over-the-air (OTA) updates to a Cordova app through window.HotCodePush, there once deviceready has fired. It serves the newest release on the app's channel in place of the binary's www and downloads the next one in the background. When the app does not come up on a release, the plugin rolls back on its own. The short version is the site's Cordova code push page.
It supports cordova-ios 8 and cordova-android 15 and 14, on iOS 15.0 and Android 7.0 (API 24) and later. The policy is on Supported versions.
Set up in one command
Let your coding agent do it: install the HotCodePush skills and paste the prompt on Installation. Agent skills explains what the agent does.
npx skills add hotcodepush-team/skillsOr run the CLI yourself. init runs cordova plugin add, writes hotcodepush.json and signs you in. There is nothing to wire, since the plugin brings its own build step:
npx hotcodepush initUse it
document.addEventListener('deviceready', async () => {
const result = await HotCodePush.sync();
console.log(result.status);
});sync() runs one cycle, check, download and apply, and resolves a typed result. With the defaults the plugin runs the same cycle on its own at every start. A TypeScript project imports the types from the package with import type.
Reference
- Installation has the AI prompt,
initand the setup by hand, step by step. - Configuration lists every
hotcodepush.jsonoption with its type and default. - API documents every method, event and type on
window.HotCodePush, with the statuses a result carries. - Source on GitHub is the SDK's repository, MIT, where an issue goes.
On the device
The plugin serves the running bundle's files on the same origin as the binary's pages, so the page's URL and its storage never change. The files cordova.js, cordova_plugins.js and plugins/ always come from the binary. Applying an update reloads the start page in the same WebView: the page's in-memory state is gone, which setRestartAllowed() and applyStrategy: manual are for.
A release that does not come up is rolled back at the next start (Readiness). A page reload or live reload applies nothing. Under AndroidInsecureFileModeEnabled the app loads from file:// and the plugin stays off. How an update reaches a device is the lifecycle.
Last updated on