• Back to io.Connect Desktop docs
io.Connect Desktop Documentation

API Reference Documentation

  • Back to io.Connect Desktop docs
Press/
  • io.Connect Desktop
  • App Management
  • App Preferences
  • Channels
  • Cookies
  • Displays
  • Hotkeys
  • Intents
  • Interception
  • Interop
  • Layouts
  • Logger
  • Metrics
  • Notifications
  • Pub Sub
  • Search
  • Shared Contexts
  • Themes
  • Windows
  • Workspaces

App Management

6.13.0

The App Management API provides a way to manage io.Connect Desktop apps. It offers abstractions for:

  • Application - a program as a logical entity, registered in io.Connect Desktop with some metadata (name, description, icon, etc.) and with all the configuration needed to spawn one or more instances of it. The App Management API provides facilities for retrieving app metadata and for detecting when an app is started.

  • Instance - a running copy of an app. The App Management API provides facilities for starting/stopping app instances and tracking app-related events.

The App Management API is accessible through the io.appManager object.

APIobject

Description

App Management API.

Properties

Property Type Default Required Description
inMemory InMemoryStore

API for handling app definitions at runtime.

myApplication Application

Returns the current app.

myInstance Instance

Returns the current app instance.

Methods

  • application
  • applications
  • exit
  • getConfigurations
  • instances
  • onAppAdded
  • onAppAvailable
  • onAppChanged
  • onAppRemoved
  • onAppUnavailable
  • onInstanceStartFailed
  • onInstanceStarted
  • onInstanceStopped
  • onInstanceUpdated
  • onShuttingDown
  • ready
  • restart

applicationmethod

Signature

(name: string) => Application

Description

Retrieves an app by name.

Parameters

Name Type Required Description
name string

Name of the desired app.

applicationsmethod

Signature

() => Application[]

Description

Retrieves a collection of the available apps.

exitmethod

Signature

(options?: ExitOpts) => Promise<any>

Description

Exits io.Connect.

Parameters

Name Type Required Description
options ExitOpts

getConfigurationsmethod

Signature

(apps?: string[]) => Promise<any[]>

Description

Retrieves the configurations of the specified apps.

Parameters

Name Type Required Description
apps string[]

List of names of the apps for which to retrieve configurations.

instancesmethod

Signature

() => Instance[]

Description

Retrieves a collection of all running app instances.

onAppAddedmethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when an app is registered in the environment.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onAppAvailablemethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when an app is available and can be started.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onAppChangedmethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when the configuration for an app has changed.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onAppRemovedmethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when an app is removed from the environment.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onAppUnavailablemethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when an app is no longer available and can't be started.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onInstanceStartedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when a new app instance is started.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

onInstanceStartFailedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when starting a new app instance has failed.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

onInstanceStoppedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when an app instance is stopped.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

onInstanceUpdatedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when an app instance is updated.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

onShuttingDownmethod

Signature

(callback: (args: ShuttingDownEventArgs) => Promise<{ prevent: boolean; }>) => void

Description

Notifies when io.Connect will shut down or restart. If the callback is asynchronous, it will be awaited up to 60 seconds before shutdown continues.

Parameters

Name Type Required Description
callback (args: ShuttingDownEventArgs) => Promise<{ prevent: boolean; }>

Callback function for handling the event.

readymethod

Signature

() => Promise<void>

Description

Notifies when the App Management API is ready to be used.

restartmethod

Signature

(options?: ExitOpts) => Promise<any>

Description

Restarts io.Connect.

Parameters

Name Type Required Description
options ExitOpts

Applicationobject

Description

Describes an app.

Properties

Property Type Default Required Description
allowMultiple boolean true

If true, the app can have multiple instances.

autoStart boolean

If true, the app is auto started with the framework.

available boolean

If true, the app is available and can be started.

caption string

Caption of the app.

container string

Container identifier.

hidden boolean false

If true, the app will be hidden in the io.Connect Launcher.

icon string

App icon.

iconURL string

URL of the app icon.

instances Instance[]

Array of objects describing the running app instances.

isShell boolean false

If true, the app is a shell app.

keywords string[]

An array of keywords for discovering the app more easily.

mode "html" | "flat" | "tab" | "frameless" | "unknown"

Mode of the app window. Possible values are "flat", "tab", "html" or "frameless". If the mode can't be determined (e.g., for external apps), the value is "unknown".

name string

App name.

sortOrder number

Sort indicator used when ordering apps in a list.

title string

App title.

type string

Type of the app.

userProperties PropertiesObject

Custom configuration object attached to the app.

version string

App version.

windowSettings WindowSettings

Describes the settings for the app window.

Methods

  • getConfiguration
  • onAvailable
  • onChanged
  • onInstanceStarted
  • onInstanceStopped
  • onRemoved
  • onUnavailable
  • start

getConfigurationmethod

Signature

() => Promise<any>

Description

Retrieves the app configuration.

onAvailablemethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when the app becomes available.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onChangedmethod

Signature

(callback: (app: Application) => any) => void

Description

Notifies when the app configuration is changed.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onInstanceStartedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when an instance of the app is started.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

onInstanceStoppedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when an instance of the app is stopped.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

onRemovedmethod

Signature

(callback: (app: Application) => any) => void

Description

Notifies when the app is removed.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onUnavailablemethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when the app becomes unavailable.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

startmethod

Signature

(context?: object, options?: ApplicationStartOptions) => Promise<Instance>

Description

Starts an instance of the app.

Parameters

Name Type Required Description
context object

Context to be passed to the started app instance.

options ApplicationStartOptions

Options for the started app instance that will override the default app configuration.

ApplicationStartOptionsobject

Description

Options for starting an app.

Properties

Property Type Default Required Description
allowClose boolean true

If true, the window will contain a "Close" button.

allowCollapse boolean false

If true, the window will contain a "Collapse/Expand" button.

allowExtract boolean false

If true, the window will contain an "Extract" button when in a window group. The button can be used to break out the window from the window group.

allowLockUnlock boolean false

If true, the window will contain a "Lock/Unlock" button.

allowMaximize boolean true

If true, the window will contain a "Maximize" button.

allowMinimize boolean true

If true, the window will contain a "Minimize" button.

allowTabClose boolean true

If true, the tab header will contain a "Close" button.

allowUnstick boolean true

If true, the window will be able to unstick from other io.Connect Windows.

autoAlign boolean true

If true, a snapped window will adjust its bounds to the same width/height of the window it has stuck to, and will occupy the space between other windows, if any.

autoSnap boolean true

If true, when moving the window operation ends, the window will snap to one of the approaching edges of another window, if it's close enough.

awaitInterop boolean true

If true, will wait for the Interop library to be initialized.

base64ImageSource string

Base64 image that will be used as a taskbar icon for the window. The supported formats are PNG, ICO, JPG and APNG.

borderColor string

Color for the window border. Can be a color name such as "red", or a hexadecimal RGB or ARGB value.

buttonsVisibility "off" | "onDemand" | "always" | "onFocus" "onDemand"

Determines the conditions under which the window buttons will be visible. Valid only for io.Connect Windows with mode set to "html".

cascade CascadeSettings

Settings for opening new window instances of the same app in a cascade.

channelSelector ChannelSelector

Settings for the Channel Selector UI.

collapseHeight number -1

Defines the height of the window when collapsed.

devToolsEnable boolean true

If true, allows opening a developer console using F12 for the new window.

downloadSettings DownloadSettings

Defines the file download behavior of the window.

env Record<string, string>

Key/value pairs that will be merged with the process.env object when spawning a new process for an executable app from the Node.js environment.

focus boolean true

If true, the window will be on focus when created.

hasMoveAreas boolean true

If true, the window will have move areas and the user will be able to move it. Valid only for io.Connect Windows with mode set to "html".

hasSizeAreas boolean true

If true, the user will be able to resize the window by dragging its borders. Valid only for io.Connect Windows with mode set to "html".

height number 400

Window height in pixels.

hidden boolean false

If true, the window will be started as a hidden window.

historyNavigationEnabled boolean true

If true, this will allow the users to navigate back (CTRL + Left) and forward (CTRL + Right) through the web page history.

ignoreFromLayouts boolean

If true, the window won't be saved when saving a Layout, nor closed or restored when restoring a Layout.

ignoreSavedLayout boolean false

If true, the App Default Layout of the app (last saved bounds, context, window state) will be ignored when starting the app. The app will always start with the bounds, context and state specified in its configuration.

isChild boolean false

If true, the window will open as a child window, sharing the lifetime and the environment of the opener. This property won't work if the window is opened by a Workspaces App or a Web Group App.

isCollapsed boolean false

If true, the window will start collapsed.

isSticky boolean true

If true, the window will stick to other io.Connect Windows forming groups.

left number 0

Distance of the top left window corner from the left edge of the screen in pixels.

loader Loader

Defines loader behavior.

maxHeight number

Specifies the maximum window height in pixels.

maxWidth number

Specifies the maximum window width in pixels.

minHeight number 30

Specifies the minimum window height in pixels.

minWidth number 50

Specifies the minimum window width in pixels.

mode WindowMode "flat"

io.Connect Window mode. Possible values are "flat", "tab", "html" and "frameless".

moveAreaBottomMargin string "0, 0, 0, 0"

Margin for the move area located at the bottom border of the window. The string value corresponds to the left, top, right and bottom borders of the move area. Setting this to "10, 0, 10, 0" will take away 10 pixels from the left and the right sides of the move area. Valid only for io.Connect Windows with mode set to "html".

moveAreaLeftMargin string "0, 0, 0, 0"

Margin for the move area located at the left border of the window. The string value corresponds to the left, top, right and bottom borders of the move area. Setting this to "0, 10, 0, 10" will take away 10 pixels from the top and the bottom of the move area. Valid only for io.Connect Windows with mode set to "html".

moveAreaRightMargin string "0, 0, 0, 0"

Margin for the move area located at the right border of the window. The string value corresponds to the left, top, right and bottom borders of the move area. Setting this to "0, 10, 0, 10" will take away 10 pixels from the top and the bottom of the move area. Valid only for io.Connect Windows with mode set to "html".

moveAreaThickness string "0, 12, 0, 0"

How much of the window area is to be considered as a moving area. The string value corresponds to the left, top, right and bottom borders of the window. Setting this to "0, 20, 0, 0" will set a 20 pixel thick move area at the top of the window. Valid only for io.Connect Windows with mode set to "html".

moveAreaTopMargin string "0, 0, 0, 0"

Margin for the move area located at the top border of the window. The string value corresponds to the left, top, right and bottom borders of the move area. Setting this to "10, 0, 10, 0" will take away 10 pixels from the left and the right sides of the move area. Valid only for io.Connect Windows with mode set to "html".

onTop boolean false

If true, the window will appear on top of the Z-order.

parameters string

Optional parameters that will be passed to the executable app that is to be started. The value will be used as is and no validation will be performed on it.

placement PlacementSettings

Specifies the window position relative to the screen.

preloadScripts string[]

A list of preload scripts (URLs) that will be loaded and executed before the actual page is executed.

relativeDirection RelativeDirection "right"

Direction for positioning the window relatively to the window specified in the relativeTo property. Considered only if relativeTo is supplied. Possible values are "bottom", "top", "left"and "right".

relativeTo string | IOConnectWindow

ID of the window that will be used to relatively position the new window. Can be combined with relativeDirection.

showInTaskbar boolean true

If true, the window icon will appear on the Windows taskbar. This property won't work for apps of type "exe", unless they are registered as io.Connect Windows.

showTitleBar boolean true

If true, the window will have a title bar.

sizeAreaThickness string "5, 5, 5, 5"

How much of the window area in pixels is to be considered as a sizing area. The string value corresponds to the left, top, right and bottom borders of the window. Valid only for io.Connect Windows with mode set to "html".

snappingEdges string "all"

Specifies the active io.Connect Window snapping edges. Possible values are "top", "left", "right", "bottom" and "all", or any combination of them (e.g., "left, right").

startLocation string

Specifies the window start location. Possible options are "center", "topCenter", "bottomCenter", "leftCenter", "rightCenter", "full", "topFull", "bottomFull", "leftFull" and "rightFull".

stickyFrameColor string "#5b8dc9"

Specifies the io.Connect Window frame color. Accepts a hexadecimal color as string (e.g., "#666666") or named HTML colors (e.g., "red").

stickyGroup string "Any"

If set, the io.Connect Window can only stick to windows that have the same group.

tabGroupId string

Specifies the tab group ID. If two or more tab windows are defined with the same ID, they will be hosted in the same container as tabs.

tabIndex number

The tab index of the current window. All tabs in a common tab container have different indices.

tabSelected boolean true

If true, the tab will be selected.

tabTitle string ""

Sets the tab title.

tabTooltip string ""

Sets the tab tooltip.

timeout number

Interval in seconds to wait for the app to initialize.

title string

Sets the window title. To work properly, there should be a <title> HTML tag in the page.

top number 0

Distance of the top left window corner from the top edge of the screen in pixels.

urlLoadOptions LoadURLOptions

Options for loading the window URL. Can be used for POST requests, like uploading a file or specifying additional headers.

useRandomFrameColor boolean false

If true, this will set a random frame color for the new window (from a predefined list of colors).

width number 400

Window width in pixels.

windowState FrameState "normal"

If set, the window will start in the specified state ("maximized", "minimized", "normal").

AppManagerobject

Description

App Management API that allows you to handle your interop-enabled apps.

Methods

  • application
  • applications
  • getConfigurations
  • getConfigurations
  • instances
  • onAppAdded
  • onAppAvailable
  • onAppChanged
  • onAppRemoved
  • onAppUnavailable
  • onInstanceStartFailed
  • onInstanceStarted
  • onInstanceStopped
  • onInstanceUpdated

applicationmethod

Signature

(name: string) => Application

Description

Retrieves an app by name.

Parameters

Name Type Required Description
name string

Name of the desired app.

applicationsmethod

Signature

() => Application[]

Description

Retrieves a collection of the available apps.

getConfigurationsmethod

Signature

(apps?: string[]) => Promise<any[]>

Description

Retrieves the configurations of the specified apps.

Parameters

Name Type Required Description
apps string[]

List of names of the apps for which to retrieve configurations.

getConfigurationsmethod

Signature

(apps: string[]) => Promise<Record<string, any>>

Parameters

Name Type Required Description
apps string[]

instancesmethod

Signature

() => Instance[]

Description

Retrieves a collection of all running app instances.

onAppAddedmethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when an app is registered in the environment.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onAppAvailablemethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when an app is available and can be started.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onAppChangedmethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when the configuration for an app has changed.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onAppRemovedmethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when an app is removed from the environment.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onAppUnavailablemethod

Signature

(callback: (app: Application) => any) => UnsubscribeFunction

Description

Notifies when an app is no longer available and can't be started.

Parameters

Name Type Required Description
callback (app: Application) => any

Callback function for handling the event.

onInstanceStartedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when a new app instance is started.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

onInstanceStartFailedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when starting a new app instance has failed.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

onInstanceStoppedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when an app instance is stopped.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

onInstanceUpdatedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when an app instance is updated.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

ExitOptsobject

Description

Options for shutdown or restart of io.Connect.

Properties

Property Type Default Required Description
autoSave boolean

If true, will save the current Global Layout.

showDialog boolean

If true, will show a confirmation dialog when shutting down or restarting io.Connect.

ImportResultobject

Description

Describes the result from importing app definitions at runtime.

Properties

Property Type Default Required Description
errors { app: string; error: string; }[]

Array of objects describing errors from importing app definitions.

imported string[]

Array of names of the successfully imported apps as specified in their definitions.

InMemoryStoreobject

Description

API for handling app definitions at runtime. The API methods operate only on in-memory app definitions.

Methods

  • clear
  • export
  • import
  • remove

clearmethod

Signature

() => Promise<void>

Description

Removes all app definitions from the in-memory store.

exportmethod

Signature

() => Promise<any[]>

Description

Exports all available app definitions from the in-memory store.

importmethod

Signature

(definitions: any[], mode?: "replace" | "merge") => Promise<ImportResult>

Description

Imports the provided collection of app definitions.

Parameters

Name Type Required Description
definitions any[]

A collection of app definition objects to be imported.

mode "replace" | "merge"

Mode for importing app definitions. Use "replace" (default) to replace all existing in-memory app definitions. Use "merge" to update the existing ones and add new ones.

removemethod

Signature

(name: string) => Promise<void>

Description

Removes an app definition from the in-memory store.

Parameters

Name Type Required Description
name string

Name of the app to be removed.

Instanceobject

Description

Describes an app instance.

Properties

Property Type Default Required Description
application Application

The app object of the instance.

id string

App instance ID.

interopInstance Instance

Access to the Interop instance. Use this to invoke Interop methods for the app instance.

title string

Title of the app instance.

Methods

  • activate
  • getContext
  • getWindow
  • onInteropReady
  • onStopped
  • startedBy
  • stop

activatemethod

Signature

() => Promise<InvocationResult<any>>

Description

Activates the app instance.

getContextmethod

Signature

() => Promise<object>

Description

Retrieves the starting context of the instance.

getWindowmethod

Signature

() => Promise<IOConnectWindow>

Description

Retrieves the window object corresponding to the app instance.

onInteropReadymethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when the Interop library is ready to be used.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

onStoppedmethod

Signature

(callback: (instance: Instance) => any) => UnsubscribeFunction

Description

Notifies when the instance is stopped.

Parameters

Name Type Required Description
callback (instance: Instance) => any

Callback function for handling the event.

startedBymethod

Signature

() => Promise<StartedByInfo>

Description

Retrieves information about how the current app instance was started, and about the identity of the initiator.

Available since io.Connect Desktop 9.3

stopmethod

Signature

() => Promise<void>

Description

Stops the app instance.

Intentobject

Description

Describes an Intent.

Properties

Property Type Default Required Description
contexts string[]

The type of predefined data structures with which the Intent handler app works.

customConfig object

Custom configuration for the Intent.

displayName string

Display name of the Intent. Can be used in context menus or other UI elements to visualize the Intent.

name string

Name of the Intent.

resultType string

The type of predefined data structure which the Intent handler app returns.

PropertiesObjectobject

Description

Generic object for passing properties or settings in the form of key/value pairs.

ShuttingDownEventArgsobject

Description

Describes the event for shutting down io.Connect.

Properties

Property Type Default Required Description
initiator Instance

Describes the Interop instance that has initiated the shutdown.

reason string

Reason for the shutdown.

restarting boolean

If true, io.Connect is restarting.

StartedByInfoobject

Description

Describes how the current app instance was started and provides details about the app that started it.

Properties

Property Type Default Required Description
applicationName string

Name of the app that started the current app instance.

instanceID string

ID of the app instance that started the current app instance.

startedBy "application" | "intent" | "autoStart"

Indicates how the current app instance was started. Apps can be started by other apps, by a raised Intent, or can be auto started by the system.

Modeenumeration

Description

Mode for initializing the App Management API. Use "full" to enable all features of the API. Use "skipIcons" to enable all features of the API, omitting the information about the app icons. Use "startOnly" to start the API in a restricted mode. You will be able to start apps, but the App Management API events and the information about the apps and their instances won't be available.

  • "startOnly"
  • "skipIcons"
  • "full"

  • Home
  • Privacy policy
  • Contact Us
  • interop.io
  • Overview
  • API
  • Application
  • ApplicationStartOptions
  • AppManager
  • ExitOpts
  • ImportResult
  • InMemoryStore
  • Instance
  • Intent
  • PropertiesObject
  • ShuttingDownEventArgs
  • StartedByInfo
  • Mode
Navigate
Go