# API

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

**Source**: https://docs.interop.io/browser/reference/javascript/app management/api/index.html

Application Management API.

## Properties

- **`inMemory`** (`InMemory`, required)
  Object that can be used for handling app definitions dynamically.
- **`myInstance`** (`Instance`, required)
  The instance of the application.

## Methods

### application

Returns an application by name.

```ts
(name: string) => Application
```

**Parameters**

- **`name`** (`string`, required)
  Name of the desired application.

**Returns**: `Application` - The application.

### applications

Returns a list of all applications.

```ts
() => Application[]
```

**Returns**: `Application[]` - A list of all applications.

### instances

Returns an array with all running application instances.

```ts
() => Instance[]
```

**Returns**: `Instance[]` - A list of all running application instances.

### onAppAdded

Notifies when an application is registered in the environment.
Replays the already added applications.

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

**Parameters**

- **`callback`** (`(app: Application) => any`, required)
  Callback function to handle the event. Receives the added application as a parameter.

**Returns**: `UnsubscribeFunction` - Unsubscribe function.

### onAppChanged

Notifies when the configuration for an application has changed.

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

**Parameters**

- **`callback`** (`(app: Application) => any`, required)
  Callback function to handle the event. Receives the changed application as a parameter.

**Returns**: `UnsubscribeFunction` - Unsubscribe function.

### onAppRemoved

Notifies when the application is removed from the environment.

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

**Parameters**

- **`callback`** (`(app: Application) => any`, required)
  Callback function to handle the event. Receives the removed application as a parameter.

**Returns**: `UnsubscribeFunction` - Unsubscribe function.

### onInstanceStarted

Notifies when a new application instance has been started.
Replays the already started instances.

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

**Parameters**

- **`callback`** (`(instance: Instance) => any`, required)
  Callback function to handle the event. Receives the started application instance as a parameter.

**Returns**: `UnsubscribeFunction` - Unsubscribe function.

### onInstanceStopped

Notifies when an application instance has been stopped.

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

**Parameters**

- **`callback`** (`(instance: Instance) => any`, required)
  Callback function to handle the event. Receives the stopped application instance as a parameter.

**Returns**: `UnsubscribeFunction` - Unsubscribe function.

## Related types

- [Application](https://docs.interop.io/browser/reference/javascript/app%20management/application/index.md)
- [InMemory](https://docs.interop.io/browser/reference/javascript/app%20management/inmemory/index.md)
- [Instance](https://docs.interop.io/browser/reference/javascript/app%20management/instance/index.md)
- [UnsubscribeFunction](https://docs.interop.io/browser/reference/javascript/search/unsubscribefunction/index.md)
