You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Update documentation for live updates channels and app setup
- Added descriptions and detailed instructions for managing live update channels in Japanese, Korean, and Chinese.
- Enhanced the explanation of device channel selection priority and the behavior of `setChannel()` for immediate channel switching.
- Included notes on installing the Capacitor updater plugin for different Capacitor versions in Korean and Chinese.
- Clarified the default channel behavior and best practices for channel configuration.
Copy file name to clipboardExpand all lines: src/content/docs/docs/getting-started/add-an-app.mdx
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,23 @@ In case the init command doesn't work for you, you can manually add an app.
51
51
52
52
3. Install the plugin in your app: <Codecode={`npm i @capgo/capacitor-updater`}lang="bash" />
53
53
54
+
<Asidetype="note"title="Installing for older Capacitor versions">
55
+
The command above installs the latest version (v8.x) for Capacitor 8. For older Capacitor versions, use the appropriate npm tag:
56
+
57
+
```bash
58
+
# Capacitor 7
59
+
npm i @capgo/capacitor-updater@lts-v7
60
+
61
+
# Capacitor 6
62
+
npm i @capgo/capacitor-updater@lts-v6
63
+
64
+
# Capacitor 5
65
+
npm i @capgo/capacitor-updater@lts-v5
66
+
```
67
+
68
+
Each plugin major version matches the Capacitor major version (v8 → Capacitor 8, v7 → Capacitor 7, v6 → Capacitor 6, v5 → Capacitor 5). Minor versions share the same feature set across all major versions (e.g., 5.34.0, 6.34.0, 7.34.0, and 8.34.0 all include the same features).
69
+
</Aside>
70
+
54
71
4. Configure the plugin in your `capacitor.config` <Codecode={`{\n "plugins": {\n CapacitorUpdater: {\n "appId": "Your appID",\n "autoUpdate": true,\n "version": "1.0.0"\n }\n }\n}`}lang="json" />
55
72
[See all option available](/docs/plugin/settings/). This information will be infer if not provided.
Copy file name to clipboardExpand all lines: src/content/docs/docs/live-updates/channels.mdx
+56-1Lines changed: 56 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,17 @@ A Live Update channel points to a specific JS bundle build of your app that will
14
14
When a device checks for an update, Capgo decides which channel to use in this strict order (highest priority first):
15
15
16
16
1.**Forced device mapping (Dashboard)** – Manually pin a specific device ID to a channel. Use for urgent debugging or controlled testing with a single real user. This always wins.
17
-
2.**Cloud override (per‑device) via `setChannel()` or Dashboard** – Created when your app calls `setChannel()` (often exposed in a QA/debug menu) or you change the device's channel in the dashboard. Use for QA users switching between feature / PR channels or to reproduce a user issue. Reinstalling the binary does not clear it; deleting the device entry does.
17
+
2.**Cloud override (per‑device) via Dashboard or API** – Created when you change the device's channel in the dashboard or via API. Use for QA users switching between feature / PR channels or to reproduce a user issue. Reinstalling the binary does not clear it; deleting the device entry does.
18
+
19
+
<Asidetype="tip"title="Instant Channel Switching with setChannel()">
20
+
**Starting from plugin version 5.34.0, 6.34.0, 7.34.0, or 8.0.0** (depending on your major version), `setChannel()` works differently: it contacts the backend to **validate** that the channel is allowed (checking if self-assignment is enabled for that channel), then stores the channel **locally on the device** as `defaultChannel`. This means the new channel takes effect **instantly** for the next update check—no waiting for replication.
21
+
22
+
Previously, `setChannel()` saved the channel override to the backend database (like Dashboard or API changes), and devices had to wait for data replication (up to 2 minutes) before the new channel was recognized. The new behavior only reads from the backend (for validation) and stores locally, making channel switches instant.
23
+
24
+
**Note:** Even if a channel becomes disallowed after being set locally, the backend will still validate the channel during update checks, so security is maintained.
25
+
26
+
**Important:** When channel changes are made via the Dashboard or API, there is still a replication lag of up to 2 minutes before all edge servers reflect the change. For instant channel switching, use `setChannel()` from your app code—it validates with the backend, then sets the channel locally for immediate effect.
27
+
</Aside>
18
28
3.**Capacitor config `defaultChannel` (test build default)** – If present in `capacitor.config.*` and no force/override exists, the app starts on this channel (e.g. `beta`, `qa`, `pr-123`). Intended for TestFlight / internal builds so testers land on a pre‑release channel automatically. Production builds typically leave this unset.
19
29
4.**Cloud Default Channel (primary path ~99% of users)** – If you mark a default channel in the dashboard, all normal end‑users (no force, no override, no config defaultChannel) attach here. Change it to roll out or roll back instantly—no new binary. If you have platform-specific defaults (one iOS-only, one Android-only), each device lands on the default matching its platform. Leaving the cloud default unset is allowed; in that case the device must match on steps 1–3 to receive updates.
20
30
@@ -120,6 +130,51 @@ npx @capgo/cli@latest channel set production com.example.app \
120
130
npx @capgo/cli@latest channel set beta com.example.app --self-assign
121
131
```
122
132
133
+
### Using setChannel() from Your App
134
+
135
+
The `setChannel()` method allows your app to programmatically switch channels at runtime. This is particularly useful for:
136
+
137
+
- QA/debug menus where testers can switch between channels
// Optionally trigger an immediate update check after switching
149
+
awaitCapacitorUpdater.setChannel({
150
+
channel: 'beta',
151
+
triggerAutoUpdate: true
152
+
});
153
+
```
154
+
155
+
<Asidetype="note"title="How setChannel() Works (v5.34.0+ / v6.34.0+ / v7.34.0+ / v8.0.0+)">
156
+
When `setChannel()` is called:
157
+
158
+
1.**Backend validation (read-only)**: A request is sent to the Capgo backend to validate the channel is allowed (checking self-assignment permissions)
159
+
2.**Local storage update**: If validation passes, the channel is saved to the device's local storage as `defaultChannel`
160
+
3.**Instant effect**: The next update check uses the new channel immediately (no waiting for replication)
161
+
162
+
**Why this matters:** In older versions, `setChannel()` saved the channel override to the backend database (same as Dashboard or API changes). Devices had to wait for backend replication (up to 2 minutes) before the channel change took effect. Now, `setChannel()` only reads from the backend (for validation) and stores locally, making channel switches instant.
163
+
164
+
**Security note:** Even if a channel's permissions change after being set locally (e.g., self-assignment is disabled), the backend will still validate the channel during update checks, ensuring security is maintained.
165
+
166
+
**Comparison of channel change methods:**
167
+
168
+
| Method | Effect Time | Persisted Where | Use Case |
|`setChannel()` from plugin |**Instant**| Device only (local) | User-initiated channel switching in-app |
171
+
| Dashboard device override | Up to 2 min | Backend database | Admin-initiated changes for specific devices |
172
+
| API channel assignment | Up to 2 min | Backend database | Automated backend integrations |
173
+
174
+
For the best user experience when building channel-switching UIs, always use the plugin's `setChannel()` method.
175
+
176
+
Minimum versions for local-only channel switching: **5.34.0**, **6.34.0**, **7.34.0**, or **8.0.0** (depending on your major version). Each minor version number corresponds to the same feature set across all major versions (e.g., X.34.0 includes the same features whether X is 5, 6, 7, or 8). See [plugin installation](/docs/getting-started/add-an-app/) for version tags.
Copy file name to clipboardExpand all lines: src/content/docs/es/docs/getting-started/add-an-app.mdx
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,23 @@ En caso de que el comando init no funcione para ti, puedes añadir manualmente u
52
52
53
53
3. Instala el Plugin en tu aplicación: <Codecode={`npm i @capgo/capacitor-updater`}lang="bash" />
54
54
55
+
<Asidetype="note"title="Instalación para versiones anteriores de Capacitor">
56
+
El comando anterior instala la última versión (v8.x) para Capacitor 8. Para versiones anteriores de Capacitor, usa la etiqueta npm apropiada:
57
+
58
+
```bash
59
+
# Capacitor 7
60
+
npm i @capgo/capacitor-updater@lts-v7
61
+
62
+
# Capacitor 6
63
+
npm i @capgo/capacitor-updater@lts-v6
64
+
65
+
# Capacitor 5
66
+
npm i @capgo/capacitor-updater@lts-v5
67
+
```
68
+
69
+
Cada versión mayor del plugin corresponde a la versión mayor de Capacitor (v8 → Capacitor 8, v7 → Capacitor 7, v6 → Capacitor 6, v5 → Capacitor 5). Las versiones menores comparten el mismo conjunto de características en todas las versiones mayores (ej., 5.34.0, 6.34.0, 7.34.0, y 8.34.0 incluyen las mismas características).
70
+
</Aside>
71
+
55
72
4. Configura el Plugin en tu `capacitor.config` <Codecode={`{\n "plugins": {\n CapacitorUpdater: {\n "appId": "Your appID",\n "autoUpdate": true,\n "version": "1.0.0"\n }\n }\n}`}lang="JSON" />
56
73
[Ver todas las opciones disponibles](/docs/plugin/settings/). Esta información se inferirá si no se proporciona.
Copy file name to clipboardExpand all lines: src/content/docs/es/docs/live-updates/channels.mdx
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,17 @@ Un canal de Actualización en Vivo apunta a una compilación específica del Paq
15
15
Cuando un dispositivo verifica una actualización, Capgo decide qué canal usar en este orden estricto (prioridad más alta primero):
16
16
17
17
1.**Mapeo forzado de dispositivo (Panel)** – Ancla manualmente un ID de dispositivo específico a un canal. Úsalo para depuración urgente o pruebas controladas con un solo usuario real. Esto siempre gana.
18
-
2.**Anulación en la nube (por dispositivo) vía `setChannel()` o Panel** – Creado cuando tu aplicación llama a `setChannel()` (a menudo expuesto en un menú QA/Depuración) o cambias el canal del dispositivo en el panel. Úsalo para usuarios de QA cambiando entre canales de características / PR o para reproducir un problema de usuario. Reinstalar el binario no lo borra; eliminar la entrada del dispositivo sí lo hace.
18
+
2.**Anulación en la nube (por dispositivo) vía Panel o API** – Creado cuando cambias el canal del dispositivo en el panel o vía API. Úsalo para usuarios de QA cambiando entre canales de características / PR o para reproducir un problema de usuario. Reinstalar el binario no lo borra; eliminar la entrada del dispositivo sí lo hace.
19
+
20
+
<Asidetype="tip"title="Cambio Instantáneo de Canal con setChannel()">
21
+
**A partir de la versión del plugin 5.34.0, 6.34.0, 7.34.0, o 8.0.0** (dependiendo de tu versión mayor), `setChannel()` funciona de manera diferente: contacta al backend para **validar** que el canal está permitido (verificando si la auto-asignación está habilitada para ese canal), luego almacena el canal **localmente en el dispositivo** como `defaultChannel`. Esto significa que el nuevo canal toma efecto **instantáneamente** para la próxima verificación de actualización—sin esperar replicación.
22
+
23
+
Anteriormente, `setChannel()` guardaba la anulación del canal en la base de datos del backend (igual que los cambios del Panel o API). Los dispositivos tenían que esperar la replicación del backend (hasta 2 minutos) antes de que el nuevo canal fuera reconocido. El nuevo comportamiento solo lee del backend (para validación) y almacena localmente, haciendo los cambios de canal instantáneos.
24
+
25
+
**Nota de seguridad:** Incluso si un canal se vuelve no permitido después de configurarse localmente, el backend aún validará el canal durante las verificaciones de actualización, asegurando que la seguridad se mantenga.
26
+
27
+
**Importante:** Cuando los cambios de canal se realizan vía el Panel o API, todavía hay un retraso de replicación de hasta 2 minutos. Para cambio instantáneo de canal, usa `setChannel()` desde el código de tu aplicación—valida con el backend, luego establece el canal localmente para efecto inmediato.
28
+
</Aside>
19
29
3.**Config de Capacitor `defaultChannel` (predeterminado de compilación de prueba)** – Si está presente en `capacitor.config.*` y no existe forzado/anulación, la aplicación comienza en este canal (por ejemplo, `beta`, `qa`, `pr-123`). Destinado para TestFlight / compilaciones internas para que los evaluadores aterricen automáticamente en un canal de pre-lanzamiento. Las compilaciones de producción típicamente dejan esto sin configurar.
20
30
4.**Canal Predeterminado en la Nube (ruta principal ~99% de usuarios)** – Si marcas un canal predeterminado en el panel, todos los usuarios finales normales (sin forzado, sin anulación, sin config defaultChannel) se conectan aquí. Cámbialo para desplegar o revertir al instante—sin nuevo binario. Si tienes predeterminados específicos de plataforma (uno solo para iOS, uno solo para Android), cada dispositivo aterriza en el predeterminado que coincida con su plataforma. Dejar el predeterminado en la nube sin configurar está permitido; en ese caso, el dispositivo debe coincidir en los pasos 1–3 para recibir actualizaciones.
Copy file name to clipboardExpand all lines: src/content/docs/fr/getting-started/add-an-app.mdx
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,23 @@ In case the init Commande doesn't work for you, you can manually Ajouter an Appl
52
52
53
53
3. Install the plugin in your app: <Codecode={`npm i @capgo/capacitor-updater`}lang="bash" />
54
54
55
+
<Asidetype="note"title="Installation pour les anciennes versions de Capacitor">
56
+
La commande ci-dessus installe la dernière version (v8.x) pour Capacitor 8. Pour les anciennes versions de Capacitor, utilisez le tag npm approprié :
57
+
58
+
```bash
59
+
# Capacitor 7
60
+
npm i @capgo/capacitor-updater@lts-v7
61
+
62
+
# Capacitor 6
63
+
npm i @capgo/capacitor-updater@lts-v6
64
+
65
+
# Capacitor 5
66
+
npm i @capgo/capacitor-updater@lts-v5
67
+
```
68
+
69
+
Chaque version majeure du plugin correspond à la version majeure de Capacitor (v8 → Capacitor 8, v7 → Capacitor 7, v6 → Capacitor 6, v5 → Capacitor 5). Les versions mineures partagent le même ensemble de fonctionnalités sur toutes les versions majeures (par ex., 5.34.0, 6.34.0, 7.34.0 et 8.34.0 incluent les mêmes fonctionnalités).
70
+
</Aside>
71
+
55
72
4. Configure the plugin in your `capacitor.config` <Codecode={`{\n "plugins": {\n CapacitorUpdater: {\n "appId": "Your appID",\n "autoUpdate": true,\n "version": "1.0.0"\n }\n }\n}`}lang="json" />
56
73
[See all Option Disponible](/docs/plugin/Paramètres/). This Information will be infer if not provided.
Copy file name to clipboardExpand all lines: src/content/docs/fr/live-updates/channels.mdx
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,17 @@ A Live Mise à jour Canal points to a specific JS Bundle Construction of your Ap
15
15
When a Appareil checks for an Mise à jour, Capgo decides which Canal to use in this strict order (highest priority first):
16
16
17
17
1.**Forced Appareil mapping (Tableau de bord)** – Manually pin a specific Appareil ID to a Canal. Use for urgent Débogage or controlled Test with a single real Utilisateur. This always wins.
18
-
2.**Cloud override (per‑device) via `setChannel()` or Dashboard** – Created when your app calls `setChannel()` (often exposed in a QA/debug menu) or you change the device's channel in the dashboard. Use for QA users switching between feature / PR channels or to reproduce a user issue. Reinstalling the binary does not clear it; deleting the device entry does.
18
+
2.**Cloud override (per‑device) via Dashboard or API** – Created when you change the device's channel in the dashboard or via API. Use for QA users switching between feature / PR channels or to reproduce a user issue. Reinstalling the binary does not clear it; deleting the device entry does.
19
+
20
+
<Asidetype="tip"title="Changement Instantané de Canal avec setChannel()">
21
+
**À partir de la version du plugin 5.34.0, 6.34.0, 7.34.0, ou 8.0.0** (selon votre version majeure), `setChannel()` fonctionne différemment : il contacte le backend pour **valider** que le canal est autorisé (en vérifiant si l'auto-attribution est activée pour ce canal), puis stocke le canal **localement sur l'appareil** comme `defaultChannel`. Cela signifie que le nouveau canal prend effet **instantanément** pour la prochaine vérification de mise à jour—pas d'attente pour la réplication.
22
+
23
+
Auparavant, `setChannel()` sauvegardait le remplacement du canal dans la base de données backend (comme les changements du Tableau de bord ou API). Les appareils devaient attendre la réplication backend (jusqu'à 2 minutes) avant que le nouveau canal soit reconnu. Le nouveau comportement ne lit que depuis le backend (pour la validation) et stocke localement, rendant les changements de canal instantanés.
24
+
25
+
**Note de sécurité :** Même si un canal devient non autorisé après avoir été défini localement, le backend validera toujours le canal lors des vérifications de mise à jour, assurant le maintien de la sécurité.
26
+
27
+
**Important :** Lorsque les changements de canal sont effectués via le Tableau de bord ou l'API, il y a toujours un délai de réplication pouvant aller jusqu'à 2 minutes. Pour un changement de canal instantané, utilisez `setChannel()` depuis le code de votre application—il valide avec le backend, puis définit le canal localement pour un effet immédiat.
28
+
</Aside>
19
29
3.**Capacitor config `defaultChannel` (test build default)** – If present in `capacitor.config.*` and no force/override exists, the app starts on this channel (e.g. `beta`, `qa`, `pr-123`). Intended for TestFlight / internal builds so testers land on a pre‑release channel automatically. Production builds typically leave this unset.
20
30
4.**Cloud Default Canal (primary path ~99% of Utilisateurs)** – If you mark a default Canal in the Tableau de bord, all normal end‑Utilisateurs (no force, no override, no config defaultChannel) attach here. Change it to roll out or roll Retour instantly—no Nouveau binary. If you have platform-specific defaults (one iOS-only, one Android-only), each Appareil lands on the default matching its platform. Leaving the cloud default unset is allowed; in that case the Appareil must match on steps 1–3 to receive Mises à jour.
0 commit comments