Skip to content

Getting Started

In this guide, you will learn how to set up Capawesome Cloud Live Updates in your Capacitor app.

Prerequisites

Before you begin, ensure you have:

  • A Capawesome Cloud account and organization.
  • A Capacitor app project on your local machine.

Step 1: Create an App

In order for your app to identify itself to Capawesome Cloud, you must first create an app in Capawesome Cloud. If you have already created an app, you can skip this step and proceed to Step 2.

To create an app using the Capawesome Cloud Console, select the organization you want to create the app in and click on the "Create App" button.

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

To create an app using the Capawesome CLI, use the apps:create command:

npx @capawesome/cli apps:create

You will be prompted to select the organization you want to create the app in and to provide a name for the app. The CLI will then create the app and display the app ID.

Make sure to save the app ID, as you will need it in the next step.

Step 2: Install SDK

Within your Capacitor app project, install the Capacitor Live Update plugin:

npm install @capawesome/capacitor-live-update@^7.3.0

See the Capacitor 6 Setup Guide for instructions on installing and configuring the plugin with Capacitor 6.

Next, configure the plugin by pasting the app ID from Step 1 and setting the autoUpdateStrategy option to background in the Capacitor configuration file of your project:

capacitor.config.ts
import { CapacitorConfig } from "@capacitor/cli";

const config: CapacitorConfig = {
  plugins: {
    LiveUpdate: {
      appId: "00000000-0000-0000-0000-000000000000",
      autoUpdateStrategy: "background"
    }
  }
};

export default config;
capacitor.config.json
{
  "plugins": {
    "LiveUpdate": {
      "appId": "00000000-0000-0000-0000-000000000000",
      "autoUpdateStrategy": "background"
    }
  }
}

The autoUpdateStrategy option set to background is the simplest and most effective way to keep your users up to date. It automatically checks for updates at app startup and when the app resumes, downloads them in the background, and applies them on the next app launchโ€”all without requiring any additional code or user interaction. This makes it the perfect default choice for most applications. See Update Strategies for more information on alternative strategies.

Finally, sync your Capacitor project using the Capacitor CLI to register the plugin and apply the configuration:

npx cap sync

Step 3: Publish First Update

To publish your first update, you need to create a bundle on Capawesome Cloud using the Capawesome CLI.

First, install the CLI:

npm install -D @capawesome/cli@latest

Then, create a new bundle with the following command:

npx @capawesome/cli apps:bundles:create

This command handles the web build process and creates a new bundle on Capawesome Cloud which is now available as a live update for your app. The next time your app starts or resumes, it will automatically download and apply the new bundle.

Force Update Check

When using an autoUpdateStrategy, updates are only checked on app resume if the last check was more than 15 minutes ago. To force a live update check during development, force-close your app and restart it.

Congratulations! You have successfully set up Capawesome Cloud Live Updates in your Capacitor app. ๐ŸŽ‰

Next Steps

Now that you have Live Updates set up, explore the following guides to make the most out of it.

  • Best Practices


    Learn about best practices for using Capawesome Cloud Live Updates in your Capacitor app.

    Learn More

  • Advanced Usage


    Learn about advanced features and how to customize the Live Update plugin to your needs.

    Learn More