Skip to main content
Back to plugins
@capgo/capacitor-live-reload
Tutorial
@capgo/capacitor-live-reload

Live Reload

Connect to your dev server for instant hot reloading during development

Guide

Tutorial on Live Reload

Using @capgo/capacitor-live-reload

Capacitor plugin to live reload Capacitor apps from a remote Vite dev server.

Install

bun add @capgo/capacitor-live-reload
bunx cap sync

What This Plugin Exposes

  • configureServer - Store remote dev server settings used for subsequent connections.
  • connect - Establish a WebSocket connection if one is not already active.
  • disconnect - Close the current WebSocket connection and disable auto reconnect.
  • getStatus - Returns the current connection status.

Example Usage

configureServer

Store remote dev server settings used for subsequent connections.

import { LiveReload } from '@capgo/capacitor-live-reload';

await LiveReload.configureServer({} as ConfigureServerOptions);

connect

Establish a WebSocket connection if one is not already active.

import { LiveReload } from '@capgo/capacitor-live-reload';

await LiveReload.connect();

disconnect

Close the current WebSocket connection and disable auto reconnect.

import { LiveReload } from '@capgo/capacitor-live-reload';

await LiveReload.disconnect();

getStatus

Returns the current connection status.

import { LiveReload } from '@capgo/capacitor-live-reload';

await LiveReload.getStatus();

Full Reference

Keep going from Using @capgo/capacitor-live-reload

If you are using Using @capgo/capacitor-live-reload to plan native plugin work, connect it with @capgo/capacitor-live-reload for the implementation detail in @capgo/capacitor-live-reload, Getting Started for the implementation detail in Getting Started, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins.