@capgo/capacitor-updater 7.27.6 → 7.27.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -437,9 +437,32 @@ export default config;
437
437
  notifyAppReady() => Promise<AppReadyResult>
438
438
  ```
439
439
 
440
- Notify Capacitor Updater that the current bundle is working (a rollback will occur if this method is not called on every app launch)
441
- By default this method should be called in the first 10 sec after app launch, otherwise a rollback will occur.
442
- Change this behaviour with {@link appReadyTimeout}
440
+ Notify the native layer that JavaScript initialized successfully.
441
+
442
+ **CRITICAL: You must call this method on every app launch to prevent automatic rollback.**
443
+
444
+ This is a simple notification to confirm that your bundle's JavaScript loaded and executed.
445
+ The native web server successfully served the bundle files and your JS runtime started.
446
+ That's all it checks - nothing more complex.
447
+
448
+ **What triggers rollback:**
449
+ - NOT calling this method within the timeout (default: 10 seconds)
450
+ - Complete JavaScript failure (bundle won't load at all)
451
+
452
+ **What does NOT trigger rollback:**
453
+ - Runtime errors after initialization (API failures, crashes, etc.)
454
+ - Network request failures
455
+ - Application logic errors
456
+
457
+ **IMPORTANT: Call this BEFORE any network requests.**
458
+ Don't wait for APIs, data loading, or async operations. Call it as soon as your
459
+ JavaScript bundle starts executing to confirm the bundle itself is valid.
460
+
461
+ Best practices:
462
+ - Call immediately in your app entry point (main.js, app component mount, etc.)
463
+ - Don't put it after network calls or heavy initialization
464
+ - Don't wrap it in try/catch with conditions
465
+ - Adjust {@link PluginsConfig.CapacitorUpdater.appReadyTimeout} if you need more time
443
466
 
444
467
  **Returns:** <code>Promise&lt;<a href="#appreadyresult">AppReadyResult</a>&gt;</code>
445
468
 
@@ -452,11 +475,17 @@ Change this behaviour with {@link appReadyTimeout}
452
475
  setUpdateUrl(options: UpdateUrl) => Promise<void>
453
476
  ```
454
477
 
455
- Set the updateUrl for the app, this will be used to check for updates.
478
+ Set the update URL for the app dynamically at runtime.
479
+
480
+ This overrides the {@link PluginsConfig.CapacitorUpdater.updateUrl} config value.
481
+ Requires {@link PluginsConfig.CapacitorUpdater.allowModifyUrl} to be set to `true`.
482
+
483
+ Use {@link PluginsConfig.CapacitorUpdater.persistModifyUrl} to persist this value across app restarts.
484
+ Otherwise, the URL will reset to the config value on next app launch.
456
485
 
457
486
  | Param | Type | Description |
458
487
  | ------------- | ----------------------------------------------- | ------------------------------------------------- |
459
- | **`options`** | <code><a href="#updateurl">UpdateUrl</a></code> | contains the URL to use for checking for updates. |
488
+ | **`options`** | <code><a href="#updateurl">UpdateUrl</a></code> | Contains the URL to use for checking for updates. |
460
489
 
461
490
  **Since:** 5.4.0
462
491
 
@@ -469,11 +498,17 @@ Set the updateUrl for the app, this will be used to check for updates.
469
498
  setStatsUrl(options: StatsUrl) => Promise<void>
470
499
  ```
471
500
 
472
- Set the statsUrl for the app, this will be used to send statistics. Passing an empty string will disable statistics gathering.
501
+ Set the statistics URL for the app dynamically at runtime.
502
+
503
+ This overrides the {@link PluginsConfig.CapacitorUpdater.statsUrl} config value.
504
+ Requires {@link PluginsConfig.CapacitorUpdater.allowModifyUrl} to be set to `true`.
505
+
506
+ Pass an empty string to disable statistics gathering entirely.
507
+ Use {@link PluginsConfig.CapacitorUpdater.persistModifyUrl} to persist this value across app restarts.
473
508
 
474
- | Param | Type | Description |
475
- | ------------- | --------------------------------------------- | ----------------------------------------------- |
476
- | **`options`** | <code><a href="#statsurl">StatsUrl</a></code> | contains the URL to use for sending statistics. |
509
+ | Param | Type | Description |
510
+ | ------------- | --------------------------------------------- | ------------------------------------------------------------------------------ |
511
+ | **`options`** | <code><a href="#statsurl">StatsUrl</a></code> | Contains the URL to use for sending statistics, or an empty string to disable. |
477
512
 
478
513
  **Since:** 5.4.0
479
514
 
@@ -486,11 +521,17 @@ Set the statsUrl for the app, this will be used to send statistics. Passing an e
486
521
  setChannelUrl(options: ChannelUrl) => Promise<void>
487
522
  ```
488
523
 
489
- Set the channelUrl for the app, this will be used to set the channel.
524
+ Set the channel URL for the app dynamically at runtime.
490
525
 
491
- | Param | Type | Description |
492
- | ------------- | ------------------------------------------------- | ------------------------------------------------ |
493
- | **`options`** | <code><a href="#channelurl">ChannelUrl</a></code> | contains the URL to use for setting the channel. |
526
+ This overrides the {@link PluginsConfig.CapacitorUpdater.channelUrl} config value.
527
+ Requires {@link PluginsConfig.CapacitorUpdater.allowModifyUrl} to be set to `true`.
528
+
529
+ Use {@link PluginsConfig.CapacitorUpdater.persistModifyUrl} to persist this value across app restarts.
530
+ Otherwise, the URL will reset to the config value on next app launch.
531
+
532
+ | Param | Type | Description |
533
+ | ------------- | ------------------------------------------------- | ----------------------------------------------- |
534
+ | **`options`** | <code><a href="#channelurl">ChannelUrl</a></code> | Contains the URL to use for channel operations. |
494
535
 
495
536
  **Since:** 5.4.0
496
537
 
@@ -503,7 +544,20 @@ Set the channelUrl for the app, this will be used to set the channel.
503
544
  download(options: DownloadOptions) => Promise<BundleInfo>
504
545
  ```
505
546
 
506
- Download a new bundle from the provided URL, it should be a zip file, with files inside or with a unique id inside with all your files
547
+ Download a new bundle from the provided URL for later installation.
548
+
549
+ The downloaded bundle is stored locally but not activated. To use it:
550
+ - Call {@link next} to set it for installation on next app backgrounding/restart
551
+ - Call {@link set} to activate it immediately (destroys current JavaScript context)
552
+
553
+ The URL should point to a zip file containing either:
554
+ - Your app files directly in the zip root, or
555
+ - A single folder containing all your app files
556
+
557
+ The bundle must include an `index.html` file at the root level.
558
+
559
+ For encrypted bundles, provide the `sessionKey` and `checksum` parameters.
560
+ For multi-file partial updates, provide the `manifest` array.
507
561
 
508
562
  | Param | Type | Description |
509
563
  | ------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
@@ -520,11 +574,22 @@ Download a new bundle from the provided URL, it should be a zip file, with files
520
574
  next(options: BundleId) => Promise<BundleInfo>
521
575
  ```
522
576
 
523
- Set the next bundle to be used when the app is reloaded.
577
+ Set the next bundle to be activated when the app backgrounds or restarts.
578
+
579
+ This is the recommended way to apply updates as it doesn't interrupt the user's current session.
580
+ The bundle will be activated when:
581
+ - The app is backgrounded (user switches away), or
582
+ - The app is killed and relaunched, or
583
+ - {@link reload} is called manually
584
+
585
+ Unlike {@link set}, this method does NOT destroy the current JavaScript context immediately.
586
+ Your app continues running normally until one of the above events occurs.
587
+
588
+ Use {@link setMultiDelay} to add additional conditions before the update is applied.
524
589
 
525
- | Param | Type | Description |
526
- | ------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
527
- | **`options`** | <code><a href="#bundleid">BundleId</a></code> | Contains the ID of the next Bundle to set on next app launch. {@link <a href="#bundleinfo">BundleInfo.id</a>} |
590
+ | Param | Type | Description |
591
+ | ------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
592
+ | **`options`** | <code><a href="#bundleid">BundleId</a></code> | Contains the ID of the bundle to set as next. Use {@link <a href="#bundleinfo">BundleInfo.id</a>} from a downloaded bundle. |
528
593
 
529
594
  **Returns:** <code>Promise&lt;<a href="#bundleinfo">BundleInfo</a>&gt;</code>
530
595
 
@@ -539,6 +604,22 @@ set(options: BundleId) => Promise<void>
539
604
 
540
605
  Set the current bundle and immediately reloads the app.
541
606
 
607
+ **IMPORTANT: This is a terminal operation that destroys the current JavaScript context.**
608
+
609
+ When you call this method:
610
+ - The entire JavaScript context is immediately destroyed
611
+ - The app reloads from a different folder with different files
612
+ - NO code after this call will execute
613
+ - NO promises will resolve
614
+ - NO callbacks will fire
615
+ - Event listeners registered after this call are unreliable and may never fire
616
+
617
+ The reload happens automatically - you don't need to do anything else.
618
+ If you need to preserve state like the current URL path, use the {@link PluginsConfig.CapacitorUpdater.keepUrlPathAfterReload} config option.
619
+ For other state preservation needs, save your data before calling this method (e.g., to localStorage).
620
+
621
+ **Do not** try to execute additional logic after calling `set()` - it won't work as expected.
622
+
542
623
  | Param | Type | Description |
543
624
  | ------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------- |
544
625
  | **`options`** | <code><a href="#bundleid">BundleId</a></code> | A {@link <a href="#bundleid">BundleId</a>} object containing the new bundle id to set as current. |
@@ -552,11 +633,21 @@ Set the current bundle and immediately reloads the app.
552
633
  delete(options: BundleId) => Promise<void>
553
634
  ```
554
635
 
555
- Deletes the specified bundle from the native app storage. Use with {@link list} to get the stored Bundle IDs.
636
+ Delete a bundle from local storage to free up disk space.
637
+
638
+ You cannot delete:
639
+ - The currently active bundle
640
+ - The `builtin` bundle (the version shipped with your app)
641
+ - The bundle set as `next` (call {@link next} with a different bundle first)
642
+
643
+ Use {@link list} to get all available bundle IDs.
556
644
 
557
- | Param | Type | Description |
558
- | ------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
559
- | **`options`** | <code><a href="#bundleid">BundleId</a></code> | A {@link <a href="#bundleid">BundleId</a>} object containing the ID of a bundle to delete (note, this is the bundle id, NOT the version name) |
645
+ **Note:** The bundle ID is NOT the same as the version name.
646
+ Use the `id` field from {@link <a href="#bundleinfo">BundleInfo</a>}, not the `version` field.
647
+
648
+ | Param | Type | Description |
649
+ | ------------- | --------------------------------------------- | ------------------------------------------------------------------------------------- |
650
+ | **`options`** | <code><a href="#bundleid">BundleId</a></code> | A {@link <a href="#bundleid">BundleId</a>} object containing the bundle ID to delete. |
560
651
 
561
652
  --------------------
562
653
 
@@ -567,11 +658,22 @@ Deletes the specified bundle from the native app storage. Use with {@link list}
567
658
  setBundleError(options: BundleId) => Promise<BundleInfo>
568
659
  ```
569
660
 
570
- Mark an installed bundle as errored. Only available when {@link PluginsConfig.CapacitorUpdater.allowManualBundleError} is true.
661
+ Manually mark a bundle as failed/errored in manual update mode.
662
+
663
+ This is useful when you detect that a bundle has critical issues and want to prevent
664
+ it from being used again. The bundle status will be changed to `error` and the plugin
665
+ will avoid using this bundle in the future.
666
+
667
+ **Requirements:**
668
+ - {@link PluginsConfig.CapacitorUpdater.allowManualBundleError} must be set to `true`
669
+ - Only works in manual update mode (when autoUpdate is disabled)
670
+
671
+ Common use case: After downloading and testing a bundle, you discover it has critical
672
+ bugs and want to mark it as failed so it won't be retried.
571
673
 
572
674
  | Param | Type | Description |
573
675
  | ------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------- |
574
- | **`options`** | <code><a href="#bundleid">BundleId</a></code> | A {@link <a href="#bundleid">BundleId</a>} object containing the bundle id to mark as errored. |
676
+ | **`options`** | <code><a href="#bundleid">BundleId</a></code> | A {@link <a href="#bundleid">BundleId</a>} object containing the bundle ID to mark as errored. |
575
677
 
576
678
  **Returns:** <code>Promise&lt;<a href="#bundleinfo">BundleInfo</a>&gt;</code>
577
679
 
@@ -586,11 +688,22 @@ Mark an installed bundle as errored. Only available when {@link PluginsConfig.Ca
586
688
  list(options?: ListOptions | undefined) => Promise<BundleListResult>
587
689
  ```
588
690
 
589
- Get all locally downloaded bundles in your app
691
+ Get all locally downloaded bundles stored in your app.
692
+
693
+ This returns all bundles that have been downloaded and are available locally, including:
694
+ - The currently active bundle
695
+ - The `builtin` bundle (shipped with your app)
696
+ - Any downloaded bundles waiting to be activated
697
+ - Failed bundles (with `error` status)
698
+
699
+ Use this to:
700
+ - Check available disk space by counting bundles
701
+ - Delete old bundles with {@link delete}
702
+ - Monitor bundle download status
590
703
 
591
- | Param | Type | Description |
592
- | ------------- | --------------------------------------------------- | ---------------------------------------------------------------------- |
593
- | **`options`** | <code><a href="#listoptions">ListOptions</a></code> | The {@link <a href="#listoptions">ListOptions</a>} for listing bundles |
704
+ | Param | Type | Description |
705
+ | ------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------ |
706
+ | **`options`** | <code><a href="#listoptions">ListOptions</a></code> | The {@link <a href="#listoptions">ListOptions</a>} for customizing the bundle list output. |
594
707
 
595
708
  **Returns:** <code>Promise&lt;<a href="#bundlelistresult">BundleListResult</a>&gt;</code>
596
709
 
@@ -603,11 +716,23 @@ Get all locally downloaded bundles in your app
603
716
  reset(options?: ResetOptions | undefined) => Promise<void>
604
717
  ```
605
718
 
606
- Reset the app to the `builtin` bundle (the one sent to Apple App Store / Google Play Store ) or the last successfully loaded bundle.
719
+ Reset the app to a known good bundle.
607
720
 
608
- | Param | Type | Description |
609
- | ------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
610
- | **`options`** | <code><a href="#resetoptions">ResetOptions</a></code> | Containing {@link <a href="#resetoptions">ResetOptions.toLastSuccessful</a>}, `true` resets to the builtin bundle and `false` will reset to the last successfully loaded bundle. |
721
+ This method helps recover from problematic updates by reverting to either:
722
+ - The `builtin` bundle (the original version shipped with your app to App Store/Play Store)
723
+ - The last successfully loaded bundle (most recent bundle that worked correctly)
724
+
725
+ **IMPORTANT: This triggers an immediate app reload, destroying the current JavaScript context.**
726
+ See {@link set} for details on the implications of this operation.
727
+
728
+ Use cases:
729
+ - Emergency recovery when an update causes critical issues
730
+ - Testing rollback functionality
731
+ - Providing users a "reset to factory" option
732
+
733
+ | Param | Type |
734
+ | ------------- | ----------------------------------------------------- |
735
+ | **`options`** | <code><a href="#resetoptions">ResetOptions</a></code> |
611
736
 
612
737
  --------------------
613
738
 
@@ -618,7 +743,20 @@ Reset the app to the `builtin` bundle (the one sent to Apple App Store / Google
618
743
  current() => Promise<CurrentBundleResult>
619
744
  ```
620
745
 
621
- Get the current bundle, if none are set it returns `builtin`. currentNative is the original bundle installed on the device
746
+ Get information about the currently active bundle.
747
+
748
+ Returns:
749
+ - `bundle`: The currently active bundle information
750
+ - `native`: The version of the builtin bundle (the original app version from App/Play Store)
751
+
752
+ If no updates have been applied, `bundle.id` will be `"builtin"`, indicating the app
753
+ is running the original version shipped with the native app.
754
+
755
+ Use this to:
756
+ - Display the current version to users
757
+ - Check if an update is currently active
758
+ - Compare against available updates
759
+ - Log the active bundle for debugging
622
760
 
623
761
  **Returns:** <code>Promise&lt;<a href="#currentbundleresult">CurrentBundleResult</a>&gt;</code>
624
762
 
@@ -631,7 +769,20 @@ Get the current bundle, if none are set it returns `builtin`. currentNative is t
631
769
  reload() => Promise<void>
632
770
  ```
633
771
 
634
- Reload the view
772
+ Manually reload the app to apply a pending update.
773
+
774
+ This triggers the same reload behavior that happens automatically when the app backgrounds.
775
+ If you've called {@link next} to queue an update, calling `reload()` will apply it immediately.
776
+
777
+ **IMPORTANT: This destroys the current JavaScript context immediately.**
778
+ See {@link set} for details on the implications of this operation.
779
+
780
+ Common use cases:
781
+ - Applying an update immediately after download instead of waiting for backgrounding
782
+ - Providing a "Restart now" button to users after an update is ready
783
+ - Testing update flows during development
784
+
785
+ If no update is pending (no call to {@link next}), this simply reloads the current bundle.
635
786
 
636
787
  --------------------
637
788
 
@@ -642,17 +793,26 @@ Reload the view
642
793
  setMultiDelay(options: MultiDelayConditions) => Promise<void>
643
794
  ```
644
795
 
645
- Sets a {@link <a href="#delaycondition">DelayCondition</a>} array containing conditions that the Plugin will use to delay the update.
646
- After all conditions are met, the update process will run start again as usual, so update will be installed after a backgrounding or killing the app.
647
- For the `date` kind, the value should be an iso8601 date string.
648
- For the `background` kind, the value should be a number in milliseconds.
649
- For the `nativeVersion` kind, the value should be the version number.
650
- For the `kill` kind, the value is not used.
651
- The function has inconsistent behavior the option kill do trigger the update after the first kill and not after the next background like other options. This will be fixed in a future major release.
796
+ Configure conditions that must be met before a pending update is applied.
797
+
798
+ After calling {@link next} to queue an update, use this method to control when it gets applied.
799
+ The update will only be installed after ALL specified conditions are satisfied.
800
+
801
+ Available condition types:
802
+ - `background`: Wait for the app to be backgrounded. Optionally specify duration in milliseconds.
803
+ - `kill`: Wait for the app to be killed and relaunched (**Note:** Current behavior triggers update immediately on kill, not on next background. This will be fixed in v8.)
804
+ - `date`: Wait until a specific date/time (ISO 8601 format)
805
+ - `nativeVersion`: Wait until the native app is updated to a specific version
652
806
 
653
- | Param | Type | Description |
654
- | ------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
655
- | **`options`** | <code><a href="#multidelayconditions">MultiDelayConditions</a></code> | Containing the {@link <a href="#multidelayconditions">MultiDelayConditions</a>} array of conditions to set |
807
+ Condition value formats:
808
+ - `background`: Number in milliseconds (e.g., `"300000"` for 5 minutes), or omit for immediate
809
+ - `kill`: No value needed
810
+ - `date`: ISO 8601 date string (e.g., `"2025-12-31T23:59:59Z"`)
811
+ - `nativeVersion`: Version string (e.g., `"2.0.0"`)
812
+
813
+ | Param | Type | Description |
814
+ | ------------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
815
+ | **`options`** | <code><a href="#multidelayconditions">MultiDelayConditions</a></code> | Contains the {@link <a href="#multidelayconditions">MultiDelayConditions</a>} array of conditions. |
656
816
 
657
817
  **Since:** 4.3.0
658
818
 
@@ -665,7 +825,15 @@ The function has inconsistent behavior the option kill do trigger the update aft
665
825
  cancelDelay() => Promise<void>
666
826
  ```
667
827
 
668
- Cancels a {@link <a href="#delaycondition">DelayCondition</a>} to process an update immediately.
828
+ Cancel all delay conditions and apply the pending update immediately.
829
+
830
+ If you've set delay conditions with {@link setMultiDelay}, this method clears them
831
+ and triggers the pending update to be applied on the next app background or restart.
832
+
833
+ This is useful when:
834
+ - User manually requests to update now (e.g., clicks "Update now" button)
835
+ - Your app detects it's a good time to update (e.g., user finished critical task)
836
+ - You want to override a time-based delay early
669
837
 
670
838
  **Since:** 4.0.0
671
839
 
@@ -678,11 +846,26 @@ Cancels a {@link <a href="#delaycondition">DelayCondition</a>} to process an upd
678
846
  getLatest(options?: GetLatestOptions | undefined) => Promise<LatestVersion>
679
847
  ```
680
848
 
681
- Get Latest bundle available from update Url
849
+ Check the update server for the latest available bundle version.
850
+
851
+ This queries your configured update URL (or Capgo backend) to see if a newer bundle
852
+ is available for download. It does NOT download the bundle automatically.
853
+
854
+ The response includes:
855
+ - `version`: The latest available version identifier
856
+ - `url`: Download URL for the bundle (if available)
857
+ - `breaking`: Whether this update is marked as incompatible (requires native app update)
858
+ - `message`: Optional message from the server
859
+ - `manifest`: File list for partial updates (if using multi-file downloads)
860
+
861
+ After receiving the latest version info, you can:
862
+ 1. Compare it with your current version
863
+ 2. Download it using {@link download}
864
+ 3. Apply it using {@link next} or {@link set}
682
865
 
683
- | Param | Type |
684
- | ------------- | ------------------------------------------------------------- |
685
- | **`options`** | <code><a href="#getlatestoptions">GetLatestOptions</a></code> |
866
+ | Param | Type | Description |
867
+ | ------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
868
+ | **`options`** | <code><a href="#getlatestoptions">GetLatestOptions</a></code> | Optional {@link <a href="#getlatestoptions">GetLatestOptions</a>} to specify which channel to check. |
686
869
 
687
870
  **Returns:** <code>Promise&lt;<a href="#latestversion">LatestVersion</a>&gt;</code>
688
871
 
@@ -697,15 +880,29 @@ Get Latest bundle available from update Url
697
880
  setChannel(options: SetChannelOptions) => Promise<ChannelRes>
698
881
  ```
699
882
 
700
- Sets the channel for this device. The channel has to allow for self assignment for this to work.
701
- Do not use this method to set the channel at boot.
702
- This method is to set the channel after the app is ready, and user interacted.
703
- If you want to set the channel at boot, use the {@link PluginsConfig} to set the default channel.
704
- This methods send to Capgo backend a request to link the device ID to the channel. Capgo can accept or refuse depending of the setting of your channel.
883
+ Assign this device to a specific update channel at runtime.
705
884
 
706
- | Param | Type | Description |
707
- | ------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------- |
708
- | **`options`** | <code><a href="#setchanneloptions">SetChannelOptions</a></code> | Is the {@link <a href="#setchanneloptions">SetChannelOptions</a>} channel to set |
885
+ Channels allow you to distribute different bundle versions to different groups of users
886
+ (e.g., "production", "beta", "staging"). This method switches the device to a new channel.
887
+
888
+ **Requirements:**
889
+ - The target channel must allow self-assignment (configured in your Capgo dashboard or backend)
890
+ - The backend may accept or reject the request based on channel settings
891
+
892
+ **When to use:**
893
+ - After the app is ready and the user has interacted (e.g., opted into beta program)
894
+ - To implement in-app channel switching (beta toggle, tester access, etc.)
895
+ - For user-driven channel changes
896
+
897
+ **When NOT to use:**
898
+ - At app boot/initialization - use {@link PluginsConfig.CapacitorUpdater.defaultChannel} config instead
899
+ - Before user interaction
900
+
901
+ This sends a request to the Capgo backend linking your device ID to the specified channel.
902
+
903
+ | Param | Type | Description |
904
+ | ------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
905
+ | **`options`** | <code><a href="#setchanneloptions">SetChannelOptions</a></code> | The {@link <a href="#setchanneloptions">SetChannelOptions</a>} containing the channel name and optional auto-update trigger. |
709
906
 
710
907
  **Returns:** <code>Promise&lt;<a href="#channelres">ChannelRes</a>&gt;</code>
711
908
 
@@ -720,7 +917,16 @@ This methods send to Capgo backend a request to link the device ID to the channe
720
917
  unsetChannel(options: UnsetChannelOptions) => Promise<void>
721
918
  ```
722
919
 
723
- Unset the channel for this device. The device will then return to the default channel
920
+ Remove the device's channel assignment and return to the default channel.
921
+
922
+ This unlinks the device from any specifically assigned channel, causing it to fall back to:
923
+ - The {@link PluginsConfig.CapacitorUpdater.defaultChannel} if configured, or
924
+ - Your backend's default channel for this app
925
+
926
+ Use this when:
927
+ - Users opt out of beta/testing programs
928
+ - You want to reset a device to standard update distribution
929
+ - Testing channel switching behavior
724
930
 
725
931
  | Param | Type |
726
932
  | ------------- | ------------------------------------------------------------------- |
@@ -737,7 +943,18 @@ Unset the channel for this device. The device will then return to the default ch
737
943
  getChannel() => Promise<GetChannelRes>
738
944
  ```
739
945
 
740
- Get the channel for this device
946
+ Get the current channel assigned to this device.
947
+
948
+ Returns information about:
949
+ - `channel`: The currently assigned channel name (if any)
950
+ - `allowSet`: Whether the channel allows self-assignment
951
+ - `status`: Operation status
952
+ - `error`/`message`: Additional information (if applicable)
953
+
954
+ Use this to:
955
+ - Display current channel to users (e.g., "You're on the Beta channel")
956
+ - Check if a device is on a specific channel before showing features
957
+ - Verify channel assignment after calling {@link setChannel}
741
958
 
742
959
  **Returns:** <code>Promise&lt;<a href="#getchannelres">GetChannelRes</a>&gt;</code>
743
960
 
@@ -752,7 +969,21 @@ Get the channel for this device
752
969
  listChannels() => Promise<ListChannelsResult>
753
970
  ```
754
971
 
755
- List all channels available for this device that allow self-assignment
972
+ Get a list of all channels available for this device to self-assign to.
973
+
974
+ Only returns channels where `allow_self_set` is `true`. These are channels that
975
+ users can switch to using {@link setChannel} without backend administrator intervention.
976
+
977
+ Each channel includes:
978
+ - `id`: Unique channel identifier
979
+ - `name`: Human-readable channel name
980
+ - `public`: Whether the channel is publicly visible
981
+ - `allow_self_set`: Always `true` in results (filtered to only self-assignable channels)
982
+
983
+ Use this to:
984
+ - Build a channel selector UI for users (e.g., "Join Beta" button)
985
+ - Show available testing/preview channels
986
+ - Implement channel discovery features
756
987
 
757
988
  **Returns:** <code>Promise&lt;<a href="#listchannelsresult">ListChannelsResult</a>&gt;</code>
758
989
 
@@ -767,14 +998,26 @@ List all channels available for this device that allow self-assignment
767
998
  setCustomId(options: SetCustomIdOptions) => Promise<void>
768
999
  ```
769
1000
 
770
- Set a custom ID for this device
1001
+ Set a custom identifier for this device.
1002
+
1003
+ This allows you to identify devices by your own custom ID (user ID, account ID, etc.)
1004
+ instead of or in addition to the device's unique hardware ID. The custom ID is sent
1005
+ to your update server and can be used for:
1006
+ - Targeting specific users for updates
1007
+ - Analytics and user tracking
1008
+ - Debugging and support (correlating devices with users)
1009
+ - A/B testing or feature flagging
771
1010
 
772
- When {@link PluginsConfig.CapacitorUpdater.persistCustomId} is true, the value will be stored natively and restored on the next app launch.
773
- Pass an empty string to remove any previously stored customId.
1011
+ **Persistence:**
1012
+ - When {@link PluginsConfig.CapacitorUpdater.persistCustomId} is `true`, the ID persists across app restarts
1013
+ - When `false`, the ID is only kept for the current session
774
1014
 
775
- | Param | Type | Description |
776
- | ------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
777
- | **`options`** | <code><a href="#setcustomidoptions">SetCustomIdOptions</a></code> | is the {@link <a href="#setcustomidoptions">SetCustomIdOptions</a>} customId to set |
1015
+ **Clearing the custom ID:**
1016
+ - Pass an empty string `""` to remove any stored custom ID
1017
+
1018
+ | Param | Type | Description |
1019
+ | ------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
1020
+ | **`options`** | <code><a href="#setcustomidoptions">SetCustomIdOptions</a></code> | The {@link <a href="#setcustomidoptions">SetCustomIdOptions</a>} containing the custom identifier string. |
778
1021
 
779
1022
  **Since:** 4.9.0
780
1023
 
@@ -787,7 +1030,21 @@ Pass an empty string to remove any previously stored customId.
787
1030
  getBuiltinVersion() => Promise<BuiltinVersion>
788
1031
  ```
789
1032
 
790
- Get the native app version or the builtin version if set in config
1033
+ Get the builtin bundle version (the original version shipped with your native app).
1034
+
1035
+ This returns the version of the bundle that was included when the app was installed
1036
+ from the App Store or Play Store. This is NOT the currently active bundle version -
1037
+ use {@link current} for that.
1038
+
1039
+ Returns:
1040
+ - The {@link PluginsConfig.CapacitorUpdater.version} config value if set, or
1041
+ - The native app version from platform configs (package.json, Info.plist, build.gradle)
1042
+
1043
+ Use this to:
1044
+ - Display the "factory" version to users
1045
+ - Compare against downloaded bundle versions
1046
+ - Determine if any updates have been applied
1047
+ - Debugging version mismatches
791
1048
 
792
1049
  **Returns:** <code>Promise&lt;<a href="#builtinversion">BuiltinVersion</a>&gt;</code>
793
1050
 
@@ -802,16 +1059,28 @@ Get the native app version or the builtin version if set in config
802
1059
  getDeviceId() => Promise<DeviceId>
803
1060
  ```
804
1061
 
805
- Get unique ID used to identify device (sent to auto update server).
1062
+ Get the unique, privacy-friendly identifier for this device.
1063
+
1064
+ This ID is used to identify the device when communicating with update servers.
1065
+ It's automatically generated and stored securely by the plugin.
1066
+
1067
+ **Privacy & Security characteristics:**
1068
+ - Generated as a UUID (not based on hardware identifiers)
1069
+ - Stored securely in platform-specific secure storage
1070
+ - Android: Android Keystore (persists across app reinstalls on API 23+)
1071
+ - iOS: Keychain with `kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly`
1072
+ - Not synced to cloud (iOS)
1073
+ - Follows Apple and Google privacy best practices
1074
+ - Users can clear it via system settings (Android) or keychain access (iOS)
806
1075
 
807
- This ID is privacy-friendly and follows Apple and Google best practices:
808
- - Generated as a UUID and stored securely
809
- - Android: Uses Android Keystore (persists across reinstalls on API 23+)
810
- - iOS: Uses Keychain with kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly (persists across reinstalls)
811
- - Data stays on device (not synced to cloud on iOS)
812
- - Can be cleared by user via system settings (Android) or keychain access (iOS)
1076
+ **Persistence:**
1077
+ The device ID persists across app reinstalls to maintain consistent device identity
1078
+ for update tracking and analytics.
813
1079
 
814
- The device ID now persists between app reinstalls to maintain consistent device identity.
1080
+ Use this to:
1081
+ - Debug update delivery issues (check what ID the server sees)
1082
+ - Implement device-specific features
1083
+ - Correlate server logs with specific devices
815
1084
 
816
1085
  **Returns:** <code>Promise&lt;<a href="#deviceid">DeviceId</a>&gt;</code>
817
1086
 
@@ -824,7 +1093,16 @@ The device ID now persists between app reinstalls to maintain consistent device
824
1093
  getPluginVersion() => Promise<PluginVersion>
825
1094
  ```
826
1095
 
827
- Get the native Capacitor Updater plugin version (sent to auto update server)
1096
+ Get the version of the Capacitor Updater plugin installed in your app.
1097
+
1098
+ This returns the version of the native plugin code (Android/iOS), which is sent
1099
+ to the update server with each request. This is NOT your app version or bundle version.
1100
+
1101
+ Use this to:
1102
+ - Debug plugin-specific issues (when reporting bugs)
1103
+ - Verify plugin installation and version
1104
+ - Check compatibility with backend features
1105
+ - Display in debug/about screens
828
1106
 
829
1107
  **Returns:** <code>Promise&lt;<a href="#pluginversion">PluginVersion</a>&gt;</code>
830
1108
 
@@ -837,7 +1115,18 @@ Get the native Capacitor Updater plugin version (sent to auto update server)
837
1115
  isAutoUpdateEnabled() => Promise<AutoUpdateEnabled>
838
1116
  ```
839
1117
 
840
- Get the state of auto update config.
1118
+ Check if automatic updates are currently enabled.
1119
+
1120
+ Returns `true` if {@link PluginsConfig.CapacitorUpdater.autoUpdate} is enabled,
1121
+ meaning the plugin will automatically check for, download, and apply updates.
1122
+
1123
+ Returns `false` if in manual mode, where you control the update flow using
1124
+ {@link getLatest}, {@link download}, {@link next}, and {@link set}.
1125
+
1126
+ Use this to:
1127
+ - Determine which update flow your app is using
1128
+ - Show/hide manual update UI based on mode
1129
+ - Debug update behavior
841
1130
 
842
1131
  **Returns:** <code>Promise&lt;<a href="#autoupdateenabled">AutoUpdateEnabled</a>&gt;</code>
843
1132
 
@@ -850,7 +1139,21 @@ Get the state of auto update config.
850
1139
  removeAllListeners() => Promise<void>
851
1140
  ```
852
1141
 
853
- Remove all listeners for this plugin.
1142
+ Remove all event listeners registered for this plugin.
1143
+
1144
+ This unregisters all listeners added via {@link addListener} for all event types:
1145
+ - `download`
1146
+ - `noNeedUpdate`
1147
+ - `updateAvailable`
1148
+ - `downloadComplete`
1149
+ - `downloadFailed`
1150
+ - `breakingAvailable` / `majorAvailable`
1151
+ - `updateFailed`
1152
+ - `appReloaded`
1153
+ - `appReady`
1154
+
1155
+ Use this during cleanup (e.g., when unmounting components or closing screens)
1156
+ to prevent memory leaks from lingering event listeners.
854
1157
 
855
1158
  **Since:** 1.0.0
856
1159
 
@@ -1065,7 +1368,16 @@ Listen for app ready event in the App, let you know when app is ready to use, th
1065
1368
  isAutoUpdateAvailable() => Promise<AutoUpdateAvailable>
1066
1369
  ```
1067
1370
 
1068
- Get if auto update is available (not disabled by serverUrl).
1371
+ Check if the auto-update feature is available (not disabled by custom server configuration).
1372
+
1373
+ Returns `false` when a custom `updateUrl` is configured, as this typically indicates
1374
+ you're using a self-hosted update server that may not support all auto-update features.
1375
+
1376
+ Returns `true` when using the default Capgo backend or when the feature is available.
1377
+
1378
+ This is different from {@link isAutoUpdateEnabled}:
1379
+ - `isAutoUpdateEnabled()`: Checks if auto-update MODE is turned on/off
1380
+ - `isAutoUpdateAvailable()`: Checks if auto-update is SUPPORTED with your current configuration
1069
1381
 
1070
1382
  **Returns:** <code>Promise&lt;<a href="#autoupdateavailable">AutoUpdateAvailable</a>&gt;</code>
1071
1383
 
@@ -1078,8 +1390,23 @@ Get if auto update is available (not disabled by serverUrl).
1078
1390
  getNextBundle() => Promise<BundleInfo | null>
1079
1391
  ```
1080
1392
 
1081
- Get the next bundle that will be used when the app reloads.
1082
- Returns null if no next bundle is set.
1393
+ Get information about the bundle queued to be activated on next reload.
1394
+
1395
+ Returns:
1396
+ - {@link <a href="#bundleinfo">BundleInfo</a>} object if a bundle has been queued via {@link next}
1397
+ - `null` if no update is pending
1398
+
1399
+ This is useful to:
1400
+ - Check if an update is waiting to be applied
1401
+ - Display "Update pending" status to users
1402
+ - Show version info of the queued update
1403
+ - Decide whether to show a "Restart to update" prompt
1404
+
1405
+ The queued bundle will be activated when:
1406
+ - The app is backgrounded (default behavior)
1407
+ - The app is killed and restarted
1408
+ - {@link reload} is called manually
1409
+ - Delay conditions set by {@link setMultiDelay} are met
1083
1410
 
1084
1411
  **Returns:** <code>Promise&lt;<a href="#bundleinfo">BundleInfo</a> | null&gt;</code>
1085
1412
 
@@ -1094,7 +1421,25 @@ Returns null if no next bundle is set.
1094
1421
  getFailedUpdate() => Promise<UpdateFailedEvent | null>
1095
1422
  ```
1096
1423
 
1097
- Get the most recent update that failed to install, if any. The stored value is cleared after it is retrieved once.
1424
+ Retrieve information about the most recent bundle that failed to load.
1425
+
1426
+ When a bundle fails to load (e.g., JavaScript errors prevent initialization, missing files),
1427
+ the plugin automatically rolls back and stores information about the failure. This method
1428
+ retrieves that failure information.
1429
+
1430
+ **IMPORTANT: The stored value is cleared after being retrieved once.**
1431
+ Calling this method multiple times will only return the failure info on the first call,
1432
+ then `null` on subsequent calls until another failure occurs.
1433
+
1434
+ Returns:
1435
+ - {@link <a href="#updatefailedevent">UpdateFailedEvent</a>} with bundle info if a failure was recorded
1436
+ - `null` if no failure has occurred or if it was already retrieved
1437
+
1438
+ Use this to:
1439
+ - Show users why an update failed
1440
+ - Log failure information for debugging
1441
+ - Implement custom error handling/reporting
1442
+ - Display rollback notifications
1098
1443
 
1099
1444
  **Returns:** <code>Promise&lt;<a href="#updatefailedevent">UpdateFailedEvent</a> | null&gt;</code>
1100
1445
 
@@ -1109,11 +1454,27 @@ Get the most recent update that failed to install, if any. The stored value is c
1109
1454
  setShakeMenu(options: SetShakeMenuOptions) => Promise<void>
1110
1455
  ```
1111
1456
 
1112
- Enable or disable the shake menu for debugging/testing purposes
1457
+ Enable or disable the shake gesture menu for debugging and testing.
1458
+
1459
+ When enabled, users can shake their device to open a debug menu that shows:
1460
+ - Current bundle information
1461
+ - Available bundles
1462
+ - Options to switch bundles manually
1463
+ - Update status
1113
1464
 
1114
- | Param | Type | Description |
1115
- | ------------- | ------------------------------------------------------------------- | -------------------------------------------------------- |
1116
- | **`options`** | <code><a href="#setshakemenuoptions">SetShakeMenuOptions</a></code> | Contains enabled boolean to enable or disable shake menu |
1465
+ This is useful during development and testing to:
1466
+ - Quickly test different bundle versions
1467
+ - Debug update flows
1468
+ - Switch between production and test bundles
1469
+ - Verify bundle installations
1470
+
1471
+ **Important:** Disable this in production builds or only enable for internal testers.
1472
+
1473
+ Can also be configured via {@link PluginsConfig.CapacitorUpdater.shakeMenu}.
1474
+
1475
+ | Param | Type |
1476
+ | ------------- | ------------------------------------------------------------------- |
1477
+ | **`options`** | <code><a href="#setshakemenuoptions">SetShakeMenuOptions</a></code> |
1117
1478
 
1118
1479
  **Since:** 7.5.0
1119
1480
 
@@ -1126,7 +1487,15 @@ Enable or disable the shake menu for debugging/testing purposes
1126
1487
  isShakeMenuEnabled() => Promise<ShakeMenuEnabled>
1127
1488
  ```
1128
1489
 
1129
- Get the current state of the shake menu
1490
+ Check if the shake gesture debug menu is currently enabled.
1491
+
1492
+ Returns the current state of the shake menu feature that can be toggled via
1493
+ {@link setShakeMenu} or configured via {@link PluginsConfig.CapacitorUpdater.shakeMenu}.
1494
+
1495
+ Use this to:
1496
+ - Check if debug features are enabled
1497
+ - Show/hide debug settings UI
1498
+ - Verify configuration during testing
1130
1499
 
1131
1500
  **Returns:** <code>Promise&lt;<a href="#shakemenuenabled">ShakeMenuEnabled</a>&gt;</code>
1132
1501
 
@@ -1141,7 +1510,18 @@ Get the current state of the shake menu
1141
1510
  getAppId() => Promise<GetAppIdRes>
1142
1511
  ```
1143
1512
 
1144
- Get the configured App ID
1513
+ Get the currently configured App ID used for update server communication.
1514
+
1515
+ Returns the App ID that identifies this app to the update server. This can be:
1516
+ - The value set via {@link setAppId}, or
1517
+ - The {@link PluginsConfig.CapacitorUpdater.appId} config value, or
1518
+ - The default app identifier from your native app configuration
1519
+
1520
+ Use this to:
1521
+ - Verify which App ID is being used for updates
1522
+ - Debug update delivery issues
1523
+ - Display app configuration in debug screens
1524
+ - Confirm App ID after calling {@link setAppId}
1145
1525
 
1146
1526
  **Returns:** <code>Promise&lt;<a href="#getappidres">GetAppIdRes</a>&gt;</code>
1147
1527
 
@@ -1156,11 +1536,24 @@ Get the configured App ID
1156
1536
  setAppId(options: SetAppIdOptions) => Promise<void>
1157
1537
  ```
1158
1538
 
1159
- Set the App ID for the app (requires allowModifyAppId to be true in config)
1539
+ Dynamically change the App ID used for update server communication.
1540
+
1541
+ This overrides the App ID used to identify your app to the update server, allowing you
1542
+ to switch between different app configurations at runtime (e.g., production vs staging
1543
+ app IDs, or multi-tenant configurations).
1544
+
1545
+ **Requirements:**
1546
+ - {@link PluginsConfig.CapacitorUpdater.allowModifyAppId} must be set to `true`
1547
+
1548
+ **Important considerations:**
1549
+ - Changing the App ID will affect which updates this device receives
1550
+ - The new App ID must exist on your update server
1551
+ - This is primarily for advanced use cases (multi-tenancy, environment switching)
1552
+ - Most apps should use the config-based {@link PluginsConfig.CapacitorUpdater.appId} instead
1160
1553
 
1161
- | Param | Type | Description |
1162
- | ------------- | ----------------------------------------------------------- | --------------------- |
1163
- | **`options`** | <code><a href="#setappidoptions">SetAppIdOptions</a></code> | The new App ID to set |
1554
+ | Param | Type |
1555
+ | ------------- | ----------------------------------------------------------- |
1556
+ | **`options`** | <code><a href="#setappidoptions">SetAppIdOptions</a></code> |
1164
1557
 
1165
1558
  **Since:** 7.14.0
1166
1559