Bundles¶
Bundles contain the code of the web layer of your app. They are used to deliver updates to your app in real-time without having to resubmit your app to the app stores.
Create a bundle¶
In order to create a bundle (aka "deploy a live update") on the Capawesome Cloud, you must first create the bundle locally by compiling your web application.
In Angular, for example, you can bundle your app by running ng build
. This will create a dist
or www
folder containing the compiled web assets.
Each bundle must contain an index.html
file at the root level of the folder.
To create a bundle using the Capawesome CLI, use the apps:bundles:create
command:
You will be prompted to select the app you want to create the bundle for and to provide the path to the bundle. Optionally, you can also specify a channel to associate the bundle with. The CLI will then create a zip archive of the bundle and upload it to the Capawesome Cloud.
To create a bundle using the Capawesome Cloud Console, navigate to the app you want to create the bundle for and click on the Create Bundle
button.
Next, select a file from your local file system to upload as the bundle.
To create a bundle using GitHub Actions, you can use the Capawesome Cloud Live Update Action.
Just add the following step to your GitHub Actions workflow:
- uses: capawesome-team/[email protected]
with:
# The Capawesome Cloud app ID.
# Required.
appId: ''
# The channel to deploy the update to.
channel: ''
# The path to the bundle to upload. Must be a folder or zip archive.
# Required.
path: ''
# The Capawesome Cloud API token.
# Required.
token: ''
The action will create a bundle and upload it to the Capawesome Cloud. Make sure to set at least the appId
, path
, and token
inputs.
Delete a bundle¶
A bundle can also be deleted at any time.
To delete a bundle using the Capawesome CLI, use the apps:bundles:delete
command:
You will be prompted to select the app you want to delete the bundle for and to provide the ID of the bundle. The CLI will then delete the bundle from the Capawesome Cloud.
To delete a bundle using the Capawesome Cloud Console, navigate to the app you want to delete the bundle for, and select the bundle you want to delete. In the menu, click on the "Delete" button to delete the bundle.
Advanced¶
Custom Properties¶
You can add custom properties to a bundle to provide additional information:
This can be useful for tracking metadata such as the version number, release notes, or any other information you want to associate with the bundle. Using the fetchLatestBundle(...)
method of the Capacitor Live Update plugin, you can then access these properties in your app:
import { LiveUpdate } from '@capawesome/capacitor-live-update';
const fetchLatestBundle = async () => {
const { customProperties } = await LiveUpdate.fetchLatestBundle();
// customProperties = { key1: 'value1', key2: 'value2' }
};
Custom properties can be updated at any time using the Capawesome Cloud Console or the Capawesome CLI.
Expiration¶
You can set an expiration date for a bundle to automatically delete it after a certain period of time:
This can be useful for managing the storage space of your account and ensuring that outdated bundles are removed automatically.