# Application

**Kind**: interface | **Module**: [App Management](https://docs.interop.io/desktop/reference/javascript/app%20management/index.md) | **Access**: `io.appManager.myApplication`

**Source**: https://docs.interop.io/desktop/reference/javascript/app management/application/index.html

Describes an app.

## Properties

- **`allowMultiple`** (`boolean`, required) default: `true`
  If `true`, the app can have multiple instances.
- **`autoStart`** (`boolean`, required)
  If `true`, the app is auto started with the framework.
- **`available`** (`boolean`, required)
  If `true`, the app is available and can be started.
- **`caption`** (`string`, required)
  Caption of the app.
- **`container`** (`string`, required)
  Container identifier.
- **`hidden`** (`boolean`, required) default: `false`
  If `true`, the app will be hidden in the io.Connect Launcher.
- **`icon`** (`string`, required)
  App icon.
- **`iconURL`** (`string`, required)
  URL of the app icon.
- **`instances`** (`Instance[]`, required)
  Array of objects describing the running app instances.
- **`isShell`** (`boolean`, required) default: `false`
  If `true`, the app is a shell app.
- **`keywords`** (`string[]`, optional)
  An array of keywords for discovering the app more easily.
- **`mode`** (`IOConnectDesktop.Windows.WindowMode | "unknown"`, required)
  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`, required)
  App name.
- **`sortOrder`** (`number`, required)
  Sort indicator used when ordering apps in a list.
- **`title`** (`string`, required)
  App title.
- **`type`** (`string`, required)
  Type of the app.
- **`userProperties`** (`PropertiesObject`, required)
  Custom configuration object attached to the app.
- **`version`** (`string`, required)
  App version.
- **`windowSettings`** (`IOConnectDesktop.Windows.WindowSettings`, required)
  Describes the settings for the app window.

## Methods

### getConfiguration

Retrieves the app configuration.

```ts
() => Promise<Definition>
```

**Returns**: `Promise<Definition>`

### onAvailable

Notifies when the app becomes available.

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

**Parameters**

- **`callback`** (`(app: Application) => any`, required)
  Callback function for handling the event.

**Returns**: `UnsubscribeFunction`

### onChanged

Notifies when the app configuration is changed.

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

**Parameters**

- **`callback`** (`(app: Application) => any`, required)
  Callback function for handling the event.

**Returns**: `void`

### onInstanceStarted

Notifies when an instance of the app is started.

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

**Parameters**

- **`callback`** (`(instance: Instance) => any`, required)
  Callback function for handling the event.

**Returns**: `UnsubscribeFunction`

### onInstanceStopped

Notifies when an instance of the app is stopped.

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

**Parameters**

- **`callback`** (`(instance: Instance) => any`, required)
  Callback function for handling the event.

**Returns**: `UnsubscribeFunction`

### onRemoved

Notifies when the app is removed.

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

**Parameters**

- **`callback`** (`(app: Application) => any`, required)
  Callback function for handling the event.

**Returns**: `void`

### onUnavailable

Notifies when the app becomes unavailable.

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

**Parameters**

- **`callback`** (`(app: Application) => any`, required)
  Callback function for handling the event.

**Returns**: `UnsubscribeFunction`

### start

Starts an instance of the app.

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

**Parameters**

- **`context`** (`object`, optional)
  Context to be passed to the started app instance.
- **`options`** (`ApplicationStartOptions`, optional)
  Options for the started app instance that will override the default app configuration.

**Returns**: `Promise<Instance>`

## Related types

- [ApplicationStartOptions](https://docs.interop.io/desktop/reference/javascript/app%20management/applicationstartoptions/index.md)
- [Definition](https://docs.interop.io/desktop/reference/javascript/app%20management/definition/index.md)
- [Instance](https://docs.interop.io/desktop/reference/javascript/app%20management/instance/index.md)
- [PropertiesObject](https://docs.interop.io/desktop/reference/javascript/app%20management/propertiesobject/index.md)
- [UnsubscribeFunction](https://docs.interop.io/desktop/reference/javascript/search/unsubscribefunction/index.md)
- [WindowMode](https://docs.interop.io/desktop/reference/javascript/windows/windowmode/index.md)
- [WindowSettings](https://docs.interop.io/desktop/reference/javascript/windows/windowsettings/index.md)
