Skip to content

App Module

The app module of the Bubbledesk bridge provides methods to retrieve system-level information and control the main application. Use this module when you need to access details about the app environment or programmatically exit the application.

Overview

The app interface is responsible for:

  • Fetching general information about the running Bubbledesk application and its environment.
  • Allowing programmatic exit of the app (with appropriate permissions).

These features are useful for diagnostics, analytics, and scenarios where the app needs to be closed from code (e.g., after a critical error or on user request).

Methods

MethodDescriptionReturn Type
info()Retrieves detailed information about the Bubbledesk app instance, including version, platform, and environment.Promise<AppInfo>
exit()Closes the Bubbledesk application. Requires sufficient permissions and may not be available in all contexts.Promise<void>

AppInfo structure

The AppInfo object returned by info() contains the following fields:

FieldTypeDescription
archstringThe system architecture (e.g., x64, arm64).
current_dirstringThe current working directory of the app process.
exec_dirstringThe directory where the app executable is located.
exec_pathstringThe full path to the app executable file.
has_main_windowbooleanIndicates whether the app currently has a main window open.
is_debugbooleanIndicates if the app is running in debug mode.
namestringThe display name of the application.
now_unix_msnumberThe current timestamp in milliseconds since Unix epoch.
osstringThe operating system platform (e.g., win32, darwin).
pidnumberThe process ID of the running app instance.
primary_screenAppScreenInfoInformation about the primary display screen.
screensAppScreenInfo[]Array of information objects for all connected display screens.
temp_dirstringThe path to the temporary directory used by the app.
versionstringThe version of the Bubbledesk app.
windowsAppWindowInfo[]Array of information objects for all open app windows.

AppWindowInfo

FieldTypeDescription
labelstringThe window's label or identifier.
widthnumberThe window's width in pixels.
heightnumberThe window's height in pixels.
xnumberThe x-coordinate of the window.
ynumberThe y-coordinate of the window.
is_fullscreenbooleanWhether the window is fullscreen.
is_maximizedbooleanWhether the window is maximized.
is_minimizedbooleanWhether the window is minimized.
is_visiblebooleanWhether the window is visible.

AppScreenInfo

FieldTypeDescription
namestringThe screen's name or identifier.
widthnumberThe screen's width in pixels.
heightnumberThe screen's height in pixels.
xnumberThe x-coordinate of the screen.
ynumberThe y-coordinate of the screen.
scale_factornumberThe screen's scale factor.

Example Usage

js
// Retrieve app information
const info = await Bubbledesk.app.info();
console.log('Platform:', info.os);

Notes

Efficient usage of info()

Cache the result of info() if you need app details multiple times, as the information is static for the session and repeated calls may be unnecessary.

WARNING

The exit() method will immediately terminate the Bubbledesk app if permissions allow. Use this method with caution and always ensure the user is notified or has saved their work.

All rights reserved.