Getting Started Guide

Learn how to install and use Cordova Hot Update in your app

Table of Contents

Overview

Cordova Hot Update allows you to deploy JavaScript updates to your Cordova/PhoneGap apps instantly, without going through app store review processes.

How It Works

  1. Create an Account - Sign up and subscribe to a plan
  2. Register Your App - Get your App ID and API Key
  3. Install the Plugin - Add the Cordova plugin to your project
  4. Initialize in Your App - Configure the plugin with your credentials
  5. Deploy Updates - Upload JavaScript files via the dashboard
  6. Automatic Updates - Users receive updates on next app launch
Note: This plugin uses an "always-fresh" system. Every app launch fetches the latest hotfix from the server. There's no version caching - your updates are always delivered immediately.

What You Can Update

Installation

Step 1: Create an Account

1 Sign up and subscribe

Visit our pricing page and choose a plan that fits your needs. You'll receive a 7-day free trial.

Step 2: Register Your App

2 Get your credentials

After signing up, go to your dashboard and register your app. You'll receive:

  • App ID - Unique identifier for your app
  • API Key - Secret key for authentication (save this securely!)

Step 3: Install the Cordova Plugin

3 Add plugin to your project

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
Success! The plugin is now installed in your app. Next, let's configure it.

Setup & Configuration

Initialize the Plugin

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 + '%');
    });
}
Security Warning: Never commit your API key to public repositories! Use environment variables or secure configuration management.

Enable Error Reporting (Optional)

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);
});

Using the Plugin

API Methods

initialize(options, success, error)

Initialize the plugin with your credentials.

cordova.plugins.hotUpdate.initialize({
    appId: 'YOUR_APP_ID',
    apiKey: 'YOUR_API_KEY'
}, successCallback, errorCallback);

checkForUpdate(success, error)

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);

applyUpdate(success, error, progress)

Download and apply the update.

cordova.plugins.hotUpdate.applyUpdate(
    successCallback,
    errorCallback,
    function(percent) {
        console.log('Progress:', percent + '%');
    }
);

getCurrentVersion(success, error)

Get the currently installed update version.

cordova.plugins.hotUpdate.getCurrentVersion(function(version) {
    console.log('Current version:', version);
}, errorCallback);

resetToBase(success, error)

Clear all updates and reset to the base app version.

cordova.plugins.hotUpdate.resetToBase(
    successCallback,
    errorCallback
);

Accessing Native App Version in Hotfixes

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
};

Managing Updates via Dashboard

Uploading a Hotfix

1 Go to the Hotfix Settings tab

Navigate to your dashboard and select the "Hotfix Settings" tab.

2 Enter your source URL

Provide the URL to your JavaScript file (e.g., GitHub raw URL, S3 bucket, or any public URL).

3 Configure targeting (optional)
  • Target Platform: iOS, Android, or All
  • Target Version: Specific app version or leave empty for all versions
4 Deploy the update

Click "Update Hotfix" to deploy. The system will:

  1. Fetch your JavaScript from the source URL
  2. Sign it with Ed25519 cryptographic signature
  3. Make it available to your users immediately
Note: Updates are delivered on next app launch. Users don't need to update via the app store!

Monitoring Usage

In the "Usage & Billing" tab, you can monitor:

Advanced Features

Platform Targeting

Deploy different hotfixes for iOS and Android:

  1. Go to Hotfix Settings in your dashboard
  2. Select target platform (iOS, Android, or All)
  3. Enter the appropriate source URL

Version Targeting

Deploy updates only to specific native app versions:

  1. Enter the target version (e.g., "1.0.0")
  2. Only apps with matching native version will receive the update
  3. Leave empty to target all versions

Error Reporting

View JavaScript errors from your users:

Security

All updates are secured with:

Frequently Asked Questions

General

Q: Is this allowed by Apple and Google?

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).

Q: How fast are updates delivered?

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.

Q: What happens if an update breaks my 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().

Q: Can I update native code or images?

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.

Q: How much does it cost?

A: We offer three plans:

All plans include a 7-day free trial. View pricing details

Technical

Q: Where should I host my JavaScript files?

A: You can host your hotfix files anywhere publicly accessible via HTTPS:

Q: How do I test updates before deploying to all users?

A: Use version targeting:

  1. Build a test version of your app with a unique version number (e.g., "1.0.0-beta")
  2. Deploy your update with target version "1.0.0-beta"
  3. Test thoroughly
  4. Once confirmed working, deploy with target version empty (all versions)

Q: What's the maximum update size?

A: We recommend keeping updates under 1MB for best performance. Larger updates will work but may take longer to download on slow connections.

Q: Can I use this with Ionic, Framework7, or other frameworks?

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.).

Q: How do I remove the plugin?

A: Run: cordova plugin remove cordova-hot-update

Account & Billing

Q: What happens if I exceed my query limit?

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.

Q: Can I cancel my subscription?

A: Yes, you can cancel anytime from your dashboard. Your service will continue until the end of your billing period.

Q: Can I change plans?

A: Yes, you can upgrade or downgrade your plan anytime. Changes take effect immediately, and billing is prorated.

Q: Do you offer refunds?

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.

Troubleshooting

Q: Updates aren't being applied. What should I check?

A: Check the following:

  1. Verify your App ID and API Key are correct
  2. Ensure your source URL is publicly accessible via HTTPS
  3. Check the browser console for error messages
  4. Verify you're calling initialize() in the deviceready event
  5. Confirm your subscription is active in the dashboard

Q: How do I debug update issues?

A: Enable debug logging:

cordova.plugins.hotUpdate.getStatus(function(status) {
    console.log('Plugin status:', status);
}, function(error) {
    console.error('Status check failed:', error);
});

Q: I'm getting a signature verification error

A: This usually means:

Try redeploying the update from your dashboard.

Still Have Questions?

Contact our support team at [email protected]

Or visit your dashboard to chat with us directly.

Get Started Now