App Extension Uninstall API

This page refers to src/uninstall.js file which is executed when the App Extension is uninstalled. Not all App Extensions will need an uninstall – this is an optional step.

Example of basic structure of the file:

module.exports = function (api) {
  // props and methods for "api" Object
  // are described below


Contains the ext-id (String) of this App Extension.


Is an Object which has the answers to the prompts when this App Extension gets installed. For more info on prompts, check out Prompts API.


Resolves paths within the app on which this App Extension is running. Eliminates the need to import path and resolve the paths yourself.

// resolves to root of app'src/my-file.js')

// resolves to root/src of app

// resolves to root/src-pwa of app

// resolves to root/src-ssr of app

// resolves to root/src-cordova of app

// resolves to root/src-electron of app


Contains the full path (String) to the root of the app on which this App Extension is running.


Check if another app extension is installed.

 * Check if another app extension is installed
 * @param {string} extId
 * @return {boolean} has the extension installed.
if (api.hasExtension(extId)) {
  // hey, we have it


Removes a file or folder from the app project folder (which the App Extension has installed and is no longer needed).

Be mindful about it and do not delete the files that would break developer’s app.

The path to file or folder needs to be relative to project’s root folder.

  * @param {string} __path

The above example deletes “my-folder” from the root of the app.


Get the internal persistent config of this extension. Returns empty object if it has none.

 * @return {object} cfg


Adds a message to be printed after App CLI finishes up uninstalling the App Extension and is about to exit. Can be called multiple times to register multiple exit logs.

 * @param {string} msg
api.onExitLog('Thanks for having used my extension')