Skip to content

Getting Started

In order to use Capawesome Cloud Live Updates, you must first install and configure the Capacitor Live Update plugin.

Preparation

Create an account on the Capawesome Cloud Console to get started.

Register

Installation

Within your Capacitor app project, install the plugin and sync your Capacitor project:

npm install @capawesome/capacitor-live-update
npx cap sync

Configuration

You can configure the plugin via the Capacitor configuration file. See Configuration for more information.

App ID

In order for your app to identify itself to Capawesome Cloud, you must configure an app ID:

capacitor.config.json
{
  "plugins": {
    "LiveUpdate": {
      "appId": "00000000-0000-0000-0000-000000000000"
    }
  }
}

For this, you need to create an app on the Capawesome Cloud Console.

The app ID can then be copied via the item menu:

Copy App ID

Sync your Capacitor project to apply the changes:

npx cap sync

That's it! You are now ready to use the Capawesome Cloud Live Updates plugin.

Usage

The following two methods are essential for using the plugin:

  1. ready(): Notify the plugin that the app is ready to use and no rollback is needed.
  2. sync(): Automatically download and set the latest bundle for the app.

The reload() method is optional and is only needed if you want to apply the new bundle immediately.

import { LiveUpdate } from '@capawesome/capacitor-live-update';

const ready = async () => {
    await LiveUpdate.ready();
};

const sync = async () => {
    const result = await LiveUpdate.sync();
    if (result.nextBundleId) {
        await LiveUpdate.reload();
    }
};

Check out the API reference to see what else you can do with this plugin.