Aller au contenu

Overview

Ce contenu n’est pas encore disponible dans votre langue.

Use Capgo’s Live Updates feature to update the JavaScript bundles of your app remotely, in real-time. Push JS updates directly to your users without going through the app store review process to instantly fix bugs and ship new features.

How Live Updates Work

Capgo’s Live Update system has two key components:

  1. The Capgo SDK, which you install in your app. The SDK checks for available updates and downloads them in the background.

  2. Channels, which let you target updates to specific groups of users. You can use channels to manage different release tracks, such as Production, Staging, and Dev.

When you upload a new JS bundle to Capgo and assign it to a channel, the Capgo SDK in apps configured for that channel will detect the update and download it. The next time the app restarts, the new bundle will be loaded.

Getting Started

To start using Live Updates, follow these steps:

  1. Complete the Capgo Quickstart to set up your app in Capgo and install the Capgo SDK.

  2. In your app code, call CapacitorUpdater.notifyAppReady() after your app has finished initializing. This tells the Capgo SDK that your app is ready to receive updates.

  3. Build your JS bundle and upload it to Capgo:

    Terminal window
    npm run build
    npx @capgo/cli@latest upload --channel=Production
  4. Open your app and wait for the update to download. You can check the status with:

    Terminal window
    npx @capgo/cli@latest app debug
  5. Once the update is downloaded, close and reopen your app to load the new bundle.

See the Deploying Live Updates guide for more details.

The Capgo CLI

The Capgo CLI is a powerful tool that allows developers to interact with Capgo’s services from their own CI/CD pipelines. With the CLI, you have granular control over when builds are produced and deployed, enabling you to integrate Capgo into your existing enterprise workflows.

What is the Capgo CLI for?

The Capgo CLI is designed for developers and teams who need more control and flexibility in their live update workflows. By using the CLI in your CI/CD pipelines, you can:

  • Decide exactly when to build and deploy updates, rather than relying on Capgo’s built-in automation
  • Insert your own processes, such as code signing, QA testing, or manager approvals, between the build and deploy steps
  • Integrate Capgo into your existing DevOps tooling and workflows

Authentication

To use the Capgo CLI, you’ll need to authenticate with your API key. You can generate an API key in your Capgo account settings.

To log in and securely store your API key, run:

Terminal window
npx @capgo/cli@latest login [API_KEY]

This command will then be saved for future use. You won’t need to provide your API key with each command after logging in.

Key Differences from Other CLI Tools

If you’re familiar with other live update CLI tools, there are a few key things to note about Capgo’s CLI:

  • Capgo uses a single CLI for both development and CI/CD use cases, as Capgo is focused solely on the live update feature set.

  • The Capgo CLI doesn’t require a separate installation step. It’s bundled with the @capgo/cli package and can be run directly using npx.

  • Capgo’s CLI is designed specifically for the live update workflow, so it may not include some features or commands found in more general-purpose CLI tools.

Next Steps