Learn how to install and use Cordova Hot Update in your app
Cordova Hot Update allows you to deploy JavaScript updates to your Cordova/PhoneGap apps instantly, without going through app store review processes.
Visit our pricing page and choose a plan that fits your needs. You'll receive a 7-day free trial.
After signing up, go to your dashboard and register your app. You'll receive:
In your Cordova project directory, run:
cordova plugin add cordova-hot-update
Or if using a specific version:
cordova plugin add cordova-hot-update@latest
In your app's main JavaScript file (usually index.js or app.js), add the initialization code:
// Wait for device ready
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
// Initialize Cordova Hot Update
cordova.plugins.hotUpdate.initialize({
appId: 'YOUR_APP_ID', // Replace with your App ID
apiKey: 'YOUR_API_KEY' // Replace with your API Key
}, function() {
console.log('Hot Update initialized successfully');
// Check for updates on app start
checkForUpdates();
}, function(error) {
console.error('Hot Update initialization failed:', error);
});
}
function checkForUpdates() {
cordova.plugins.hotUpdate.checkForUpdate(function(result) {
if (result.available) {
console.log('Update available:', result.version);
applyUpdate();
} else {
console.log('App is up to date');
}
}, function(error) {
console.error('Update check failed:', error);
});
}
function applyUpdate() {
cordova.plugins.hotUpdate.applyUpdate(function() {
console.log('Update applied successfully');
alert('App updated! Please restart.');
}, function(error) {
console.error('Update failed:', error);
}, function(progress) {
console.log('Download progress:', progress + '%');
});
}
Automatically report JavaScript errors to your dashboard:
// Enable automatic error reporting
cordova.plugins.hotUpdate.enableErrorReporting(true, function() {
console.log('Error reporting enabled');
}, function(error) {
console.error('Failed to enable error reporting:', error);
});
Initialize the plugin with your credentials.
cordova.plugins.hotUpdate.initialize({
appId: 'YOUR_APP_ID',
apiKey: 'YOUR_API_KEY'
}, successCallback, errorCallback);
Check if an update is available.
cordova.plugins.hotUpdate.checkForUpdate(function(result) {
console.log('Available:', result.available);
console.log('Version:', result.version);
console.log('Size:', result.size + ' bytes');
}, errorCallback);
Download and apply the update.
cordova.plugins.hotUpdate.applyUpdate(
successCallback,
errorCallback,
function(percent) {
console.log('Progress:', percent + '%');
}
);
Get the currently installed update version.
cordova.plugins.hotUpdate.getCurrentVersion(function(version) {
console.log('Current version:', version);
}, errorCallback);
Clear all updates and reset to the base app version.
cordova.plugins.hotUpdate.resetToBase(
successCallback,
errorCallback
);
Your hotfix code can access the native app version to apply version-specific logic:
// This variable is automatically available in your hotfix code
console.log(window.CordovaHotUpdateCurrentAppVersion); // e.g., "1.0.0"
// Apply version-specific fixes
if (window.CordovaHotUpdateCurrentAppVersion === '1.0.0') {
// Fix for version 1.0.0 only
window.fixOldApiBug = function() {
// Workaround code
};
} else if (window.CordovaHotUpdateCurrentAppVersion >= '1.0.1') {
// Enhancement for v1.0.1+
window.newFeature = function() {
// New functionality
};
}
// Global fixes apply to all versions
window.criticalBugFix = function() {
// This runs on all app versions
};
Navigate to your dashboard and select the "Hotfix Settings" tab.
Provide the URL to your JavaScript file (e.g., GitHub raw URL, S3 bucket, or any public URL).
Click "Update Hotfix" to deploy. The system will:
In the "Usage & Billing" tab, you can monitor:
Deploy different hotfixes for iOS and Android:
Deploy updates only to specific native app versions:
View JavaScript errors from your users:
All updates are secured with:
A: Yes! As long as you're updating JavaScript/HTML/CSS only (not native code) and not changing the core purpose of your app, this is compliant with both Apple and Google policies. Many popular apps use similar technologies (e.g., React Native CodePush).
A: Updates are fetched on every app launch. Once you deploy an update via the dashboard, it's available immediately. Users will receive it the next time they open your app.
A: The plugin includes automatic rollback. If an update fails to execute or causes errors, the plugin will revert to the previous working version. You can also manually reset to the base version using resetToBase().
A: No. This plugin only supports JavaScript, HTML, and CSS updates. For native code changes or new binary assets, you need to submit a new app version to the app stores. For images, host them remotely and reference via URL.
A: We offer three plans:
All plans include a 7-day free trial. View pricing details
A: You can host your hotfix files anywhere publicly accessible via HTTPS:
https://raw.githubusercontent.com/user/repo/main/hotfix.js)A: Use version targeting:
A: We recommend keeping updates under 1MB for best performance. Larger updates will work but may take longer to download on slow connections.
A: Yes! This plugin works with any Cordova-based app, regardless of the JavaScript framework you use (Ionic, Framework7, Vue, React, Angular, vanilla JS, etc.).
A: Run: cordova plugin remove cordova-hot-update
A: Your updates will continue to work, but you'll be charged for overage at $0.10 per 1,000 additional queries. You can upgrade to a higher plan anytime to avoid overage charges.
A: Yes, you can cancel anytime from your dashboard. Your service will continue until the end of your billing period.
A: Yes, you can upgrade or downgrade your plan anytime. Changes take effect immediately, and billing is prorated.
A: We offer a 7-day free trial so you can test the service. After that, we provide prorated refunds within 30 days if you're not satisfied.
A: Check the following:
initialize() in the deviceready eventA: Enable debug logging:
cordova.plugins.hotUpdate.getStatus(function(status) {
console.log('Plugin status:', status);
}, function(error) {
console.error('Status check failed:', error);
});
A: This usually means:
Try redeploying the update from your dashboard.
Contact our support team at [email protected]
Or visit your dashboard to chat with us directly.