# Server

Source: https://docs.interop.io/manager/configuration/server/index.html

## Overview

The following sections provide a comprehensive reference documentation of the available settings for configuring the **io.Manager** Server via the [configuration object](#configuration_object) for initializing the [`@interopio/manager`](https://www.npmjs.com/package/@interopio/manager) library and via the respective [environment variables](#environment_variables), depending on your [deployment](https://docs.interop.io/manager/deployment/index.md) approach.

> ℹ️ *For full examples on configuring **io.Manager** and its various features via the `Config` object for initializing the `@interopio/manager` library and via environment variables, see the [**io.Manager** Examples](https://github.com/InteropIO/manager-examples) repository on GitHub.*

## Configuration Object

The `start()` method of the [`@interopio/manager`](https://www.npmjs.com/package/@interopio/manager) library accepts a `Config` object with settings for initializing the **io.Manager** Server.

> ⚠️ *Note that if you provide initialization settings for the **io.Manager** Server via the configuration object passed to the `start()` method, the settings provided via [environment variables](#environment_variables) will be ignored.*

The following example demonstrates basic configuration for initializing the `@interopio/manager` library:

```javascript
import { start } from "@interopio/manager";

const config: Config = {
    // Name for the io.Manager Server. Used for logging purposes.
    name: "my-server",
    // Port on which the io.Manager Server will listen.
    port: 4242,
    // Base path for the io.Manager REST API.
    base: "api",
    // It's required to provide a valid license key for io.Manager.
    licenseKey: "my-license-key",
    // It's required to provide settings for one of the supported database stores to use.
    store: {
        // Using MongoDB as a database store.
        type: "mongo",
        // MongoDB connection string.
        connection: "mongodb://localhost:27017/my_db"
    },
    // It's required to provide settings for the token used for communicating with
    // the io.Connect platform clients connected to io.Manager.
    token: {
        // Symmetric key for signing a JWT.
        secret: "my-secret"
    },
    // Settings for Basic authentication.
    auth_method: "basic",
    auth_basic: {
        // List of users in the `user-id:password` format. The specified users will be created in the database,
        // will be granted administrative privileges, and will have access to the Admin UI.
        predefinedUsers: ["admin:admin"],
        // Configuring the user session length for the Admin UI.
        sessionLifetime: 7200
    },
    // Session cookies are enabled by default when using Basic authentication,
    // which means that it's required to specify CORS options.
    cors: {
        credentials: true,
        origin: "http://localhost:3000"
    }
};

const server = await start(config);
```

### Top-Level Keys

The following table describes all top-level keys of the `Config` object for initializing the `@interopio/manager` library:

| Property | Type | Description |
|----------|------|-------------|
| `advancedLayouts` | `object` | Configuration for advanced Layouts. Accepts an [`AdvancedLayoutsConfig`](#configuration_object-advancedlayoutsconfig) object as a value. *Available since **io.Manager** 4.0 & **io.Connect Desktop** 10.5 (unreleased).* |
| `audit` | `object` | Configuration for the audit service of the **io.Manager** Server. This service creates audit logs for the various entities and entity-related operations in **io.Manager**. Accepts an [`AuditConfig`](#configuration_object-auditconfig) object as a value. |
| `audit_custom` | `object` | Custom audit service implementation. Accepts an [`AuditService`](#configuration_object-auditservice) object as a value. See [Server Extension Points](#server_extension_points-custom_audit_service). |
| `auth_auth0` | `object` | Configuration for [Auth0](https://docs.interop.io/manager/authentication/auth0/index.md) authentication. Accepts an [`Auth0Options`](#configuration_object-auth0options) object as a value. Valid only if the `auth_method` property is set to `"auth0"`. |
| `auth_basic` | `object` | Configuration for [Basic](https://docs.interop.io/manager/authentication/basic/index.md) authentication. Accepts an [`AuthBasicConfig`](#configuration_object-authbasicconfig) object as a value. Valid only if the `auth_method` property is set to `"basic"`. |
| `auth_custom` | `object` | [Custom](https://docs.interop.io/manager/authentication/custom/index.md) authentication implementation. Accepts a `CustomAuthenticator` object as a value. Valid only if the `auth_method` property is set to `"custom"`. See [Server Extension Points](#server_extension_points-custom_authenticator). |
| `auth_exclusive_users` | `string[]` | List of users that will be assigned to the `GLUE42_SERVER_ADMIN` group, which grants unrestricted access to the Admin UI and to every protected endpoint of the **io.Manager** Server. The users must already exist in the database. Defaults to `[]`. |
| `auth_extra_groups` | `Group[]` | List of additional groups. Accepts an array of [`Group`](#configuration_object-group) objects. The supplied entries are merged with the built-in default groups, which take precedence over an entry with the same `name`. For the full list of available permission groups and default group mappings, see [Authorization](https://docs.interop.io/manager/authorization/index.md). *Available since **io.Manager** 4.0.* |
| `auth_method` | `"auth0"` \| `"okta"` \| `"none"` \| `"basic"` \| `"custom"` | Authentication method. Defaults to `"none"`. |
| `auth_none` | `object` | Configuration for [None](https://docs.interop.io/manager/authentication/none/index.md) authentication. Accepts an [`AuthNoneConfig`](#configuration_object-authnoneconfig) object as a value. Valid only if the `auth_method` property is set to `"none"`. |
| `auth_okta` | `object` | Configuration for [Okta](https://docs.interop.io/manager/authentication/okta/index.md) authentication. Accepts an [`OktaConfiguration`](#configuration_object-oktaconfiguration) object as a value. Valid only if the `auth_method` property is set to `"okta"`. |
| `auth_timeout` | `number` | Interval in milliseconds to wait for the authentication process request to complete before rejecting it. Defaults to `120000`. *Available since **io.Manager** Server 2.0.* |
| `base` | `string` | Base path for the API that will be added to the **io.Manager** Server origin. If you set this to `"api"`, the server will listen on `<origin>/api` (e.g., `http://localhost:4242/api`). Defaults to `""`. |
| `cors` | `object` | CORS options. Required when session cookies are enabled. Accepts a [`CorsOptions`](https://expressjs.com/en/resources/middleware/cors.html#configuration-options) object as a value. *Available since **io.Manager** Server 2.0.* |
| `expose_stop` | `boolean` | If `true`, will expose a `GET /<base>/stop` endpoint that shuts down the **io.Manager** Server. Defaults to `false`. |
| `groups_service` | `object` | Accepts a custom `GroupsService` implementation. See [Server Extension Points](#server_extension_points-custom_groups_service). |
| `healthEndpoints` | `object` | Configuration for the [health check](https://docs.interop.io/manager/deployment/index.md#health_checks) endpoints exposed by the **io.Manager** Server. Accepts a [`HealthEndpointsConfig`](#configuration_object-healthendpointsconfig) object as a value. |
| `interceptProcessSignals` | `boolean` | If `true`, **io.Manager** will listen for the following signals: `SIGINT`, `SIGTERM`, `SIGHUP`, `SIGBREAK`, and `SIGQUIT`. When any of these signals has been received, **io.Manager** will shut itself down gracefully. Defaults to `false`. *Available since **io.Manager** Server 2.0.* |
| `licenseKey` | `string` | **Required.** Valid [license key](https://docs.interop.io/manager/requirements/index.md#licensing) for **io.Manager**. |
| `monitoring` | `object` | Monitoring tool to be used. Accepts a [`NoneMonitoringConfig`](#configuration_object-nonemonitoringconfig) or a [`SentryMonitoringConfig`](#configuration_object-sentrymonitoringconfig) object as a value. Defaults to `{ type: "none" }`. |
| `name` | `string` | Name for the **io.Manager** Server. Used for logging purposes. Defaults to `"local"`. |
| `openApi` | `object` | Configuration for the [OpenAPI](https://docs.interop.io/manager/open-api-support/index.md) support provided by **io.Manager**. Accepts an [`OpenAPIConfig`](#configuration_object-openapiconfig) object as a value. *Available since **io.Manager** Server 2.0.* |
| `otel` | `object` | Configuration for the [OpenTelemetry](https://docs.interop.io/manager/opentelemetry-support/overview/index.md) support provided by **io.Manager**. Accepts an [`OtelConfig`](#configuration_object-otelconfig) object as a value. *Available since **io.Manager** Server 1.7.* |
| `port` | `string` \| `number` | Port to use for the **io.Manager** Server. If set to a string that can't be converted to a number, it will be treated as a path. Defaults to `4356`. |
| `purge` | `object` | Configuration for [database size management](https://docs.interop.io/manager/databases/overview/index.md#database_size_management). Accepts a [`PurgeConfig`](#configuration_object-purgeconfig) object as a value. |
| `schemas` | `object` | Schema validation configuration. Accepts a [`SchemasConfig`](#configuration_object-schemasconfig) object as a value. |
| `serverConfig` | `object` | HTTP/HTTPS protocol configuration for the **io.Manager** Server. Accepts a [`WebServerConfig`](#configuration_object-webserverconfig) object as a value. |
| `sessions` | `object` | Configuration for the sessions between the io.Connect platform clients and the **io.Manager** Server. Accepts a [`SessionsConfig`](#configuration_object-sessionsconfig) object as a value. *Available since **io.Manager** Server 2.1.* |
| `skipProcessExitOnStop` | `boolean` | If `true`, won't call `process.exit()` on shutdown. Defaults to `true`. |
| `store` | `object` | **Required.** Configuration for the database store to be used by the **io.Manager** Server. Accepts a [`MongoStoreConfig`](#configuration_object-mongostoreconfig), a [`PostgreSQLStoreConfig`](#configuration_object-postgresqlstoreconfig), or an [`MSSQLStoreConfig`](#configuration_object-mssqlstoreconfig) object as a value. |
| `token` | `object` | **Required.** Configuration for the token used for communicating with the io.Connect platform clients connected to **io.Manager**. Accepts a [`TokenConfig`](#configuration_object-tokenconfig) object as a value. |
| `username_case_sensitive` | `boolean` | If `true`, username comparison will be case-sensitive. Defaults to `false`. |

> ⚠️ *Note that usernames are stored exactly as they are received and `username_case_sensitive` controls how they are compared rather than how they are stored. This means that you can change this setting in either direction without migrating any data.*

### AdvancedLayoutsConfig

Available since io.Manager 4.0 & io.Connect Desktop 10.5 (unreleased)

Configuration for advanced Layouts served by the **io.Manager** Server.

| Property | Type | Description |
|----------|------|-------------|
| `enabled` | `boolean` | If `true`, the **io.Manager** Server serves advanced Layouts to io.Connect platform clients instead of legacy Layouts. Defaults to `false`. |
| `migration` | `object` | Settings of the one-time migration of legacy Layouts to advanced Layouts. Accepts a [`LayoutsMigrationConfig`](#configuration_object-layoutsmigrationconfig) object as a value. |
| `sharingRequiredGroup` | `string` | Name of a group whose members are allowed to save advanced Layouts with `accessLevel` set to `"shared"` or `"public"`. Membership in nested groups is honored. Saving advanced Layouts with `accessLevel` set to `"private"` is never restricted. When omitted, any authenticated user may share or publish advanced Layouts. |

> ⚠️ *Note that **io.Manager** and all connected io.Connect platform clients must be configured to use the same version of Layouts - either legacy or advanced. This means that the value of the `enabled` property of the `AdvancedLayoutsConfig` object must always match the value of the respective setting in the system configuration of each connected io.Connect platform client. For instance, for **io.Connect Desktop**, this corresponds to the `"enabled"` property of the `"advancedLayouts"` object under the `"server"` top-level key in the `system.json` system configuration file (see [Configuration > Platform > io.Connect Desktop](https://docs.interop.io/manager/configuration/platform/index.md#ioconnect_desktop)).*

### AuditConfig

Configuration for the audit service of the **io.Manager** Server.

| Property | Type | Description |
|----------|------|-------------|
| `enabled` | `boolean` | If `true` (default), the **io.Manager** Server generates audit logs. Set to `false` to disable auditing entirely - no audit logs are generated, the audit log REST API returns no entries, and any custom audit service provided via `audit_custom` is bypassed. |
| `types` | `object` | Object with settings for enabling or disabling audit log generation per entity type (e.g., `{ application: true, layout: false }`). Audit log generation can be additionally controlled per entity-related operation (e.g., `{ application: { delete: false } }`). Defaults to `{ session: false, user: false }`. |

#### Audit Log Entities & Operations

The `types` property of the `AuditConfig` object accepts as a value an object with properties representing the entity types (e.g., `application`, `layout`, `sessions`, and more) for which to control the audit log generation. Each property can be set to a Boolean value or to an object with properties representing the entity-related operations for which to control the audit log generation:

- To enable or disable audit log generation for all operations related to a specific entity type, use a Boolean value (e.g., `{ application: true, layout: false }`).

- To control audit log generation per entity-related operation, use an object value (e.g., `{ application: { delete: false } }`).

The `types` object has the following properties:

| Property | Type | Description |
|----------|------|-------------|
| `application` | `boolean` \| `object` | Controls audit log generation for app entities. Defaults to `true`. |
| `app-prefs` | `boolean` \| `object` | Controls audit log generation for app preferences entities. Defaults to `true`. |
| `audit-log` | `boolean` \| `object` | Controls audit log generation for audit log entities. Defaults to `true`. |
| `command` | `boolean` \| `object` | Controls audit log generation for command entities. Defaults to `true`. |
| `crash` | `boolean` \| `object` | Controls audit log generation for crash report entities. Defaults to `true`. |
| `feedback` | `boolean` \| `object` | Controls audit log generation for feedback report entities. Defaults to `true`. |
| `glue42config` | `boolean` \| `object` | Controls audit log generation for platform configuration entities. Defaults to `true`. |
| `group` | `boolean` \| `object` | Controls audit log generation for user group entities. Defaults to `true`. |
| `layout` | `boolean` \| `object` | Controls audit log generation for Layout entities. |
| `machine` | `boolean` \| `object` | Controls audit log generation for machine entities. Defaults to `true`. |
| `session` | `boolean` \| `object` | Controls audit log generation for session entities. Defaults to `false`. |
| `user` | `boolean` \| `object` | Controls audit log generation for user entities. Defaults to `false`. |

Each audit log entity in the `types` object can be set to an object with the following properties representing the entity-related operations for which to control the audit log generation:

| Property | Type | Description |
|----------|------|-------------|
| `close` | `boolean` | If `true`, will enable audit log generation for close operations. |
| `closeMany` | `boolean` | If `true`, will enable audit log generation for bulk close operations. |
| `create` | `boolean` | If `true`, will enable audit log generation for create operations. |
| `delete` | `boolean` | If `true`, will enable audit log generation for delete operations. |
| `deleteAll` | `boolean` | If `true`, will enable audit log generation for delete all operations. |
| `deleteMany` | `boolean` | If `true`, will enable audit log generation for bulk delete operations. |
| `import` | `boolean` | If `true`, will enable audit log generation for import operations. |
| `open` | `boolean` | If `true`, will enable audit log generation for open operations. |
| `setDefaultLayout` | `boolean` | If `true`, will enable audit log generation for set default Global Layout operations. |
| `update` | `boolean` | If `true`, will enable audit log generation for update operations. |

The following table shows the valid operations for each entity:

| Entity | Operations |
|--------|------------|
| `application` | `create`, `delete`, `deleteAll`, `import`, `update` |
| `app-prefs` | `create`, `delete`, `deleteMany`, `update` |
| `audit-log` | `deleteAll`, `deleteMany` |
| `command` | `create`, `delete`, `deleteMany`, `update` |
| `crash` | `create`, `delete`, `deleteMany`, `update` |
| `feedback` | `create`, `delete`, `deleteMany`, `update` |
| `glue42config` | `create`, `delete`, `update` |
| `group` | `create`, `delete`, `deleteAll` |
| `layout` | `create`, `delete`, `deleteAll`, `deleteMany`, `setDefaultLayout`, `update` |
| `machine` | `deleteMany` |
| `session` | `close`, `closeMany`, `delete`, `deleteMany`, `open` |
| `user` | `create`, `delete`, `deleteAll`, `import`, `update` |

### AuditService

Custom implementation of an audit service to be used by the **io.Manager** Server.

| Property | Type | Signature | Description |
|----------|------|-----------|-------------|
| `add()` | `function` | `(builder: AuditBuilder) => Promise<void>` | Adds an audit log entry. |
| `clean()` | `function` | `(request: CleanAuditLogRequest, audit: AuditBuilder, user: User \| undefined) => Promise<void>` | Cleans audit log entries based on the provided request. |
| `get()` | `function` | `(id: string) => Promise<AuditLog>` | Retrieves a single audit log entry by its ID. |
| `getAll()` | `function` | `(request?: DataRequest) => Promise<AuditLogDataResult>` | Retrieves all audit log entries. |

### Auth0Options

Configuration for [Auth0](https://docs.interop.io/manager/authentication/auth0/index.md) authentication.

| Property | Type | Description |
|----------|------|-------------|
| `audience` | `string` | URL pointing to the resource that will consume the access token. |
| `issuer` | `string` | URL pointing to the issuer to be used for validation of access tokens. Unnecessary if `issuerBaseURL` is provided. |
| `issuerBaseURL` | `string` | Base URL of the issuer to be used for validation of access tokens. Unnecessary if `issuer` and `jwksUri` are provided. |
| `jwksUri` | `string` | URL pointing to a JSON Web Key Set. Unnecessary if `issuerBaseURL` is provided. |
| `tokenSigningAlg` | `string` | Algorithm for signing the access tokens. |

> ⚠️ *Note that it's required to provide either only `issuerBaseURL` or `issuer` and `jwksUri` together.*

### AuthBasicConfig

Configuration for [Basic](https://docs.interop.io/manager/authentication/basic/index.md) authentication.

| Property | Type | Description |
|----------|------|-------------|
| `predefinedUsers` | `string[]` | List of predefined users that will be created and added to the database and will be assigned to the `GLUE42_SERVER_ADMIN` group, which grants unrestricted access to the Admin UI and to every protected endpoint of the **io.Manager** Server. Accepts an array of strings in the format `user-id:password`. |
| `sessionLifetime` | `number` | Interval in seconds at which the session will expire and the user will be logged out of the **io.Manager** Admin UI. Valid only if `useSessionCookie` is set to `true` and the CORS options are configured properly via the `cors` property. Defaults to `3600`. *Available since **io.Manager** Server 2.1.* |
| `useSessionCookie` | `boolean` | If `true` (default), **io.Manager** will use a signed JWT stored in a session cookie to manage the Admin UI user sessions. Set to `false` to disable session cookies. If session cookies are enabled, it's required to specify CORS options via the `cors` property. *Available since **io.Manager** Server 2.1.* |

### AuthNoneConfig

Configuration for [None](https://docs.interop.io/manager/authentication/none/index.md) authentication.

| Property | Type | Description |
|----------|------|-------------|
| `allowOnlyKnownUsers` | `boolean` | If `true`, only the users that are already in the **io.Manager** database will be allowed to connect. If `false`, all users will be allowed to connect and new users will be automatically added to the database. Defaults to `false`. |

### Group

Definition of a custom group that will be added to the built-in default groups.

| Property | Type | Description |
|----------|------|-------------|
| `description` | `string` | Description for the group. |
| `expandsTo` | `string[]` | Names of the groups whose permissions the members of this group also receive. Accepts granular permission groups, other custom groups, or built-in default groups. |
| `name` | `string` | **Required.** Name of the group. |

### GroupsService

Custom implementation of a Groups service to be used by the **io.Manager** Server.

| Property | Type | Signature | Description |
|----------|------|-----------|-------------|
| `addGroup()` | `function` | `(group: Group, audit: AuditBuilder) => Promise<Group>` | Creates a group and returns it. |
| `addOrUpdateGroup()` | `function` | `(group: Group, audit: AuditBuilder) => Promise<Group>` | Creates a group, or overwrites it if a group with that name already exists, and returns it. |
| `addUserToGroups()` | `function` | `(user: string, groups: string[], audit: AuditBuilder) => Promise<void>` | Assigns the given groups to a user. |
| `getAllGroups()` | `function` | `(request?: DataRequest) => Promise<GroupDataResult>` | Retrieves the groups matching the request. |
| `getGroup()` | `function` | `(name: string) => Promise<Group \| undefined>` | Retrieves a single group by its name. |
| `getSupportedFeatures()` | `function` | `() => GroupsFeatures` | Declares which of the operations the implementation supports. |
| `getUserGroups()` | `function` | `(user: string \| User) => Promise<string[]>` | Retrieves the names of the groups a user belongs to. |
| `removeAll()` | `function` | `(audit: AuditBuilder) => Promise<void>` | Removes all groups. |
| `removeGroup()` | `function` | `(name: string, audit: AuditBuilder) => Promise<void>` | Removes a group by its name. |
| `removeUserFromGroups()` | `function` | `(user: string, groups: string[], audit: AuditBuilder) => Promise<void>` | Removes the given groups from a user. |
| `updateGroup()` | `function` | `(group: Group, audit: AuditBuilder) => Promise<Group>` | Updates an existing group and returns it. |

### HealthEndpointsConfig

Configuration for the [health check](https://docs.interop.io/manager/deployment/index.md#health_checks) endpoints exposed by the **io.Manager** Server.

| Property | Type | Description |
|----------|------|-------------|
| `customDatabaseHealthCheckRoute` | `string` | If present, an additional database health check endpoint will be available on the specified route. The health check behaves exactly the same as when invoking the `GET /db-connectivity` endpoint. *Available since **io.Manager** Server 1.8.* |
| `customHealthCheckRoute` | `string` | If present, an additional health check endpoint will be available on the specified route. The health check behaves exactly the same as when invoking the `GET /` endpoint. *Available since **io.Manager** Server 1.8.* |
| `databaseHealthCheckStatus` | `string` | The string that the database connectivity health check will return as a successful response. Defaults to `"OK"`. *Available since **io.Manager** Server 1.8.1.* |
| `dbConnectivityQuery` | `string` | SQL query executed by the database connectivity health check when using PostgreSQL or Microsoft SQL Server. Defaults to `"select 1"`. *Available since **io.Manager** 4.0.* |
| `dbConnectivityTimeout` | `number` | Interval in milliseconds to wait for a response from the database when performing a database connectivity health check. Defaults to `2000`. |
| `healthCheckStatus` | `string` | String that will be passed as a value to the `"status"` field in the health check response. Defaults to `"OK"`. *Available since **io.Manager** Server 1.8.1.* |

> ⚠️ *Note that when providing custom health check routes via the `customHealthCheckRoute` and the `customDatabaseHealthCheckRoute` properties, the base API path specified in the `base` property of the configuration object for initializing the **io.Manager** Server won't be taken into account.*

### LayoutsMigrationConfig

Available since io.Manager 4.0 & io.Connect Desktop 10.5 (unreleased)

Settings of the one-time migration of legacy Layouts to advanced Layouts.

| Property | Type | Description |
|----------|------|-------------|
| `claimStaleness` | `number` | Time in milliseconds after which an abandoned Layout migration run may be taken over by a new run. Must be a finite number greater than zero. Defaults to `600000` (10 minutes). |
| `pageSize` | `number` | Number of legacy Layouts a migration run reads and writes at a time. Lower values reduce the run's memory use and higher values reduce the number of database round trips. Must be an integer greater than zero. Defaults to `1000`. |

### MetricDefinition

The `MetricDefinition` type is a union of different metric types. All metric types share common base properties and each available metric type may have additional specific properties.

#### Available Metric Types

The **io.Manager** Server exports the following metrics:

| Metric | Instrument Type | Description |
|--------|-----------------|-------------|
| `"http.server.active_requests"` | `UpDownCounter` | Number of active HTTP server requests. |
| `"http.server.request.body.size"` | `Histogram` | Size of HTTP server request bodies. |
| `"http.server.request.duration"` | `Histogram` | Duration of HTTP server requests. |
| `"http.server.response.body.size"` | `Histogram` | Size of HTTP server response bodies. |
| `"io_manager.active_sessions"` | `Gauge` | Total number of sessions that have made requests within a past interval. This interval is defined by the `inactiveSessionTimeout` metric property, it's measured in seconds and is configurable. |

#### Base Properties

All metric types have the following properties:

| Property | Type | Description |
|----------|------|-------------|
| `description` | `string` | Description for the metric. |
| `enabled` | `boolean` | If `true`, will enable publishing the metric. Defaults to the value of the `defaultMetricsEnabled` property of the [`OtelMetricsConfig`](#configuration_object-otelmetricsconfig) object. |
| `name` | `string` | Name for the metric. Defaults to the value of `type`. |
| `type` | `string` | **Required.** The metric type. Must be set to one of the available metric types. |
| `unit` | `string` | Unit for the metric values. |

#### Histogram Metrics

Metrics of instrument type `Histogram` have the following additional properties:

| Property | Type | Description |
|----------|------|-------------|
| `buckets` | `number[]` | Histogram bucket boundaries. |

#### Active Sessions Metric

The `"io_manager.active_sessions"` metric has the following additional properties:

| Property | Type | Description |
|----------|------|-------------|
| `inactiveSessionTimeout` | `number` | Interval in seconds after which a session is considered inactive. Must be set to the same value as the `fetchInterval` property of the `server` object in the [platform configuration](https://docs.interop.io/manager/configuration/platform/index.md) (**io.Connect Desktop** or **io.Connect Browser**) for **io.Manager**. Defaults to `30`. |
| `publishAtStartupEnabled` | `boolean` | If `true` (default), the **io.Manager** Server will publish the metric at startup. |
| `publishInterval` | `number` | Interval in milliseconds at which to publish the metric. Defaults to `60000`. |

### MongoStoreConfig

Configuration for using a [MongoDB database](https://docs.interop.io/manager/databases/mongo/index.md) as a data store for the **io.Manager** Server.

| Property | Type | Description |
|----------|------|-------------|
| `connection` | `string` | **Required.** MongoDB connection URL. |
| `transactions` | `"disabled"` \| `"required"` \| `"autodetect"` | Whether to use MongoDB multi-document transactions, which require MongoDB to be deployed as a replica set or a sharded cluster. Set to `"required"` to prevent the server from starting when the MongoDB deployment doesn't support transactions, or to `"disabled"` to never use transactions. Defaults to `"autodetect"` - transactions are used when the deployment supports them, otherwise the server logs a warning and runs without transactions. *Available since **io.Manager** 4.0.* |
| `type` | `string` | **Required.** Type of the data store. Must be set to `"mongo"` when using a MongoDB database. |

### MSSQLStoreConfig

Configuration for using a [Microsoft SQL Server database](https://docs.interop.io/manager/databases/microsoft-sql/index.md) as a data store for the **io.Manager** Server.

| Property | Type | Description |
|----------|------|-------------|
| `createDatabaseAndTables` | `boolean` | If `true` (default), will automatically create and initialize the database and the tables necessary for **io.Manager**. Set to `false` if you want to do this separately. For more details on database schema creation and migration, see the [Database Schema](https://docs.interop.io/manager/databases/microsoft-sql/index.md#database_schema) section. |
| `dbName` | `string` | Database name for the Microsoft SQL Server connection URL. Defaults to `"test"`. |
| `domain` | `string` | Windows domain for login. |
| `driver` | `string` | Microsoft SQL Server driver name as used in the [Knex.js](https://knexjs.org/) library. |
| `migrationRetries` | `number` | How many times store initialization - creating the database, creating the schema and running the migration scripts - is retried after a transient failure, such as another server instance initializing the same database concurrently. The error of the final attempt is propagated. Defaults to `3`. *Available since **io.Manager** 4.0.* |
| `migrationRetryDelayMs` | `number` | The delay in milliseconds between store initialization retry attempts. Defaults to `1000`. *Available since **io.Manager** 4.0.* |
| `options` | `object` | Additional Microsoft SQL Server connection options. |
| `password` | `string` | Password for authentication. |
| `poolConfig` | `object` | [Knex.js](https://knexjs.org/) pool configuration. For more details, see the [official Knex.js documentation](https://knexjs.org/guide/#pool). |
| `port` | `number` | Port for the Microsoft SQL Server connection URL. |
| `server` | `string` | **Required.** Host for the Microsoft SQL Server connection URL. |
| `transactionIsolation` | `"database-default"` \| `"read-committed"` \| `"snapshot"` \| `"serializable"` | The isolation level for the database transactions the server opens. `"database-default"` leaves the database's own default isolation level in effect. Defaults to `"database-default"`. <br> ⚠️ *Note that `"snapshot"` requires the database to have `ALLOW_SNAPSHOT_ISOLATION` enabled - otherwise, the server won't start.* <br> *Available since **io.Manager** 4.0.* |
| `transactionRetries` | `number` | How many times a database transaction, or a standalone read, is re-run after a transient failure. Set to `0` to disable the retry. Defaults to `3`. *Available since **io.Manager** 4.0.* |
| `transactionRetryDelayMs` | `number` | The base delay in milliseconds between retry attempts. The actual delay is randomized and increases with each retry. Defaults to `100`. *Available since **io.Manager** 4.0.* |
| `type` | `string` | **Required.** Type of the data store. Must be set to `"mssql"` when using a Microsoft SQL Server database. |
| `userName` | `string` | Username for authentication. |

### NoneMonitoringConfig

Configuration for when a monitoring tool isn't used in the **io.Manager** Server.

| Property | Type | Description |
|----------|------|-------------|
| `type` | `string` | **Required.** Monitoring tool type. Must be set to `"none"` when a monitoring tool isn't used. |

### OktaConfiguration

Configuration for [Okta](https://docs.interop.io/manager/authentication/okta/index.md) authentication.

| Property | Type | Description |
|----------|------|-------------|
| `audiences` | `string[]` | **Required.** List of URLs pointing to the resources that will consume the access token. |
| `groupsClaimsName` | `string` | The name of the JWT claim from which to retrieve the Okta user groups. Defaults to `"groups"`. |
| `verifierOptions` | `object` | **Required.** Object with options passed to the constructor of the `OktaJwtVerifier` class exposed by the [`@okta/jwt-verifier`](https://www.npmjs.com/package/@okta/jwt-verifier) library. The only required property is `issuer`. |

### OpenAPIConfig

Configuration for the [OpenAPI](https://docs.interop.io/manager/open-api-support/index.md) support provided by **io.Manager**.

| Property | Type | Description |
|----------|------|-------------|
| `customSecurityScheme` | `object` | [`SecuritySchemeObject`](https://github.com/nestjs/swagger/blob/master/lib/interfaces/open-api-spec.interface.ts) object. If present and if a custom authenticator is used, will be set as the security scheme. This allows making requests via the Swagger UI when custom authentication is used. For more details, see the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/authentication/). |
| `enableSwaggerUI` | `boolean` | If `true` (default), **io.Manager** will serve the Swagger UI. |
| `processOpenAPIObject` | `function` | Function with the following signature: `(doc: OpenAPIObject) => OpenAPIObject`. Providing this function enables you to gain full control over the OpenAPI document described by the [`OpenAPIObject`](https://github.com/nestjs/swagger/blob/master/lib/interfaces/open-api-spec.interface.ts) object. |
| `swaggerCustomOptions` | `object` | [`Partial<SwaggerCustomOptions>`](https://github.com/nestjs/swagger/blob/master/lib/interfaces/swagger-custom-options.interface.ts) object. Custom options for the Swagger UI. This will be merged into an object that will be passed as an argument to the `setup()` method of the [`SwaggerModule`](https://github.com/nestjs/swagger/blob/master/lib/swagger-module.ts) instance. |
| `swaggerUIRoute` | `string` | Route on which **io.Manager** will serve the Swagger UI. Defaults to `"swagger"`. |

### OtelConfig

Configuration for the [OpenTelemetry](https://docs.interop.io/manager/opentelemetry-support/overview/index.md) support provided by **io.Manager**.

| Property | Type | Description |
|----------|------|-------------|
| `diagnosticLoggerLevel` | `enum` | [`DiagLogLevel`](https://open-telemetry.github.io/opentelemetry-js/enums/_opentelemetry_api._opentelemetry_api.DiagLogLevel.html) enumeration specifying the logging level for the OpenTelemetry diagnostic logger. This is only used to diagnose issues with the OpenTelemetry setup or SDK. Defaults to `DiagLogLevel.WARN`. |
| `enabled` | `boolean` | If `true`, will enable publishing OpenTelemetry data. Defaults to `false`. |
| `logs` | `object` | Settings for publishing OpenTelemetry [logs](https://docs.interop.io/manager/opentelemetry-support/logs/index.md). Accepts an [`OtelLoggingConfig`](#configuration_object-otelloggingconfig) object as a value. |
| `metrics` | `object` | Settings for publishing OpenTelemetry [metrics](https://docs.interop.io/manager/opentelemetry-support/metrics/index.md). Accepts an [`OtelMetricsConfig`](#configuration_object-otelmetricsconfig) object as a value. |
| `resource` | `object` | **Required.** OpenTelemetry [resource](https://opentelemetry.io/docs/concepts/resources/) configuration. Accepts an [`OtelResourceConfig`](#configuration_object-otelresourceconfig) object as a value. |
| `traces` | `object` | Settings for publishing OpenTelemetry [traces](https://docs.interop.io/manager/opentelemetry-support/traces/index.md). Accepts an [`OtelTracingConfig`](#configuration_object-oteltracingconfig) object as a value. |

### OtelLoggingConfig

Settings for publishing OpenTelemetry [logs](https://docs.interop.io/manager/opentelemetry-support/logs/index.md).

| Property | Type | Description |
|----------|------|-------------|
| `customExporter` | `object` | [`LogRecordExporter`](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_sdk-logs.LogRecordExporter.html) instance of a [custom log exporter](https://docs.interop.io/manager/opentelemetry-support/logs/index.md#customization-log_exporter) to be used instead of the default log exporter. Ignored when a [custom log processor](https://docs.interop.io/manager/opentelemetry-support/logs/index.md#customization-log_processor) is used. |
| `customProcessor` | `object` | [`LogRecordProcessor`](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_sdk-logs.LogRecordProcessor.html) instance of a custom log processor to be used instead of the default log processor. |
| `enabled` | `boolean` | If `true`, will enable publishing OpenTelemetry logs. Defaults to `false`. |
| `maxLevel` | `"ALL"` \| `"MARK"` \| `"TRACE"` \| `"DEBUG"` \| `"INFO"` \| `"WARN"` \| `"ERROR"` \| `"FATAL"` \| `"OFF"` | The maximum event level to emit via the OpenTelemetry SDK. Defaults to `"FATAL"`. |
| `minLevel` | `"ALL"` \| `"MARK"` \| `"TRACE"` \| `"DEBUG"` \| `"INFO"` \| `"WARN"` \| `"ERROR"` \| `"FATAL"` \| `"OFF"` | The minimum event level to emit via the OpenTelemetry SDK. Defaults to `"INFO"`. |
| `publishInterval` | `number` | Interval in milliseconds between two consecutive log exports. Passed to the [`BatchLogRecordProcessor`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_sdk-logs.BatchLogRecordProcessor.html) constructor. This is the default log processor used by the **io.Manager** Server. Ignored when a custom log processor is used. Defaults to `5000`. |
| `url` | `string` | URL pointing to an [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) where the generated logs will be sent via HTTP. Passed to the [`OTLPLogExporter`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_exporter-logs-otlp-http.OTLPLogExporter.html) constructor. This is the default log exporter used by the **io.Manager** Server. Required if using the default log exporter and log processor. Ignored when either a custom log exporter or a custom log processor is used. |

### OtelMetricsConfig

Settings for publishing OpenTelemetry [metrics](https://docs.interop.io/manager/opentelemetry-support/metrics/index.md).

| Property | Type | Description |
|----------|------|-------------|
| `customExporter` | `object` | [`PushMetricExporter`](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_sdk-metrics.PushMetricExporter.html) instance of a [custom metrics exporter](https://docs.interop.io/manager/opentelemetry-support/metrics/index.md#customization-metrics_exporter) to be used instead of the default metrics exporter. Ignored when a [custom metrics reader](https://docs.interop.io/manager/opentelemetry-support/metrics/index.md#customization-metrics_reader) is used. |
| `customReader` | `object` | [`MetricReader`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_sdk-metrics.MetricReader.html) instance of a custom metrics reader to be used instead of the default metrics reader. |
| `defaultMetricsEnabled` | `boolean` | If `true` (default), will enable publishing of all available metrics. |
| `enabled` | `boolean` | If `true`, will enable publishing OpenTelemetry metrics. Defaults to `false`. |
| `metrics` | `object[]` | List of metric definition objects with configuration for the available metrics. |
| `publishInterval` | `number` | Interval in milliseconds at which the metrics reader will collect metrics. Passed to the [`PeriodicExportingMetricReader`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_sdk-metrics.PeriodicExportingMetricReader.html) constructor. This is the default metrics reader used by the **io.Manager** Server. Ignored when a custom metrics reader is used. Defaults to `5000`. |
| `url` | `string` | URL pointing to an [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) where the generated metrics will be sent via HTTP. Passed to the [`OTLPMetricExporter`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_exporter-metrics-otlp-http.OTLPMetricExporter.html) constructor. This is the default metrics exporter used by the **io.Manager** Server. Required if using the default metrics exporter and metrics reader. Ignored when either a custom metrics exporter or a custom metrics reader is used. |

### OtelResourceConfig

OpenTelemetry [resource](https://opentelemetry.io/docs/concepts/resources/) configuration.

| Property | Type | Description |
|----------|------|-------------|
| `customAttributes` | `object` | An [`Attributes`](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_api._opentelemetry_api.Attributes.html) object representing a set of custom attributes that will be applied to the resource. |
| `deploymentEnvironment` | `string` | Value for the [`deployment.environment.name`](https://opentelemetry.io/docs/specs/semconv/attributes-registry/deployment/#deployment-environment-name) resource attribute. Name of the deployment environment. |
| `serviceInstanceID` | `string` | Value for the [`service.instance.id`](https://opentelemetry.io/docs/specs/semconv/attributes-registry/service/#service-instance-id) resource attribute. Must be unique for each `service.namespace` and `service.name` pair. The instance ID helps to distinguish instances of the same service that exist at the same time (e.g., instances of a horizontally scaled service). |
| `serviceName` | `string` | **Required.** Value for the [`service.name`](https://opentelemetry.io/docs/specs/semconv/attributes-registry/service/#service-name) resource attribute. Logical name of the service. Must be the same for all instances of horizontally scaled services. |
| `serviceNamespace` | `string` | Value for the [`service.namespace`](https://opentelemetry.io/docs/specs/semconv/attributes-registry/service/#service-namespace) resource attribute. Namespace for the `service.name` attribute. This should be a value that will help distinguish a group of services semantically from other groups of services - e.g., the name of the team that owns the group of services. The value of each `service.name` attribute within the same namespace must be unique. If a `service.namespace` attribute isn't specified for the resource, then the `service.name` attribute must be unique among all services without an explicitly defined namespace (an unspecified namespace is simply one more valid namespace). A zero-length string value for a namespace equals an unspecified namespace. |

### OtelTracingConfig

Settings for publishing OpenTelemetry [traces](https://docs.interop.io/manager/opentelemetry-support/traces/index.md).

| Property | Type | Description |
|----------|------|-------------|
| `customExporter` | `object` | [`SpanExporter`](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_sdk-trace-base.SpanExporter.html) instance of a [custom trace exporter](https://docs.interop.io/manager/opentelemetry-support/traces/index.md#customization-trace_exporter) to be used instead of the default trace exporter. Ignored when a [custom trace span processor](https://docs.interop.io/manager/opentelemetry-support/traces/index.md#customization-trace_span_processor) is used. |
| `customContextManager` | `object` | [`ContextManager`](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_api._opentelemetry_api.ContextManager.html) instance of a custom context manager. *Available since **io.Manager** Server 2.0.* |
| `customProcessor` | `object` | [`SpanProcessor`](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_sdk-trace-base.SpanProcessor.html) instance of a [custom trace span processor](https://docs.interop.io/manager/opentelemetry-support/traces/index.md#customization-trace_span_processor) to be used instead of the default span processor. |
| `customPropagator` | `object` | [`TextMapPropagator`](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_api._opentelemetry_api.TextMapPropagator.html) instance of a custom context propagator. *Available since **io.Manager** Server 2.0.* |
| `customSampler` | `object` | [`Sampler`](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_sdk-trace-base.Sampler.html) instance of a [custom trace sampler](https://docs.interop.io/manager/opentelemetry-support/traces/index.md#customization-trace_sampler) to be used instead of the default trace sampler. When using a custom trace sampler, the settings specified in the `sampling` and `default` properties will be ignored. |
| `default` | `object` | Default trace settings to be applied to all traces not matched by any of the rules specified in the `sampling` array. |
| `enabled` | `boolean` | If `true`, will enable publishing OpenTelemetry traces. Defaults to `false`. |
| `publishInterval` | `number` | Interval in milliseconds between two consecutive trace exports. Passed to the [`BatchSpanProcessor`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_sdk-trace-base.BatchSpanProcessor.html) constructor. This is the default span processor used by the **io.Manager** Server. Ignored when a [custom trace span processor](https://docs.interop.io/manager/opentelemetry-support/traces/index.md#customization-trace_span_processor) is used. Defaults to `5000`. |
| `sampling` | `object[]` | List of objects each describing rules for matching trace spans. Each object also specifies a rate to be used for sampling the matched trace spans. Ignored when a custom trace sampler is used. |
| `url` | `string` | URL pointing to an [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) where the generated traces will be sent via HTTP. Passed to the [`OTLPTraceExporter`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_exporter-trace-otlp-http.OTLPTraceExporter.html) constructor. This is the default trace exporter used by the **io.Manager** Server. Required if using the default trace exporter and trace span processor. Ignored when either a [custom trace exporter](https://docs.interop.io/manager/opentelemetry-support/traces/index.md#customization-trace_exporter) or a custom trace span processor is used. |

The `default` object has the following properties:

| Property | Type | Description |
|----------|------|-------------|
| `sample` | `number` | Specifies the rate to be used by the default trace sampler for sampling all trace spans that don't match the rules specified in the `sampling` array. Accepts as a value a number greater than `0` and less than or equal to `1` denoting the [probability](https://opentelemetry.io/docs/specs/otel/trace/tracestate-probability-sampling-experimental/) percentage for sampling traces (e.g., a value of `0.15` means that all trace spans not matched by any rules will have a 15% probability of being sampled). Ignored when a custom trace sampler is used. Defaults to `1`. |

Each object in the `sampling` array has the following properties:

| Property | Type | Description |
|----------|------|-------------|
| `attributes` | `object` | Collection of type `{ [key: string]: string \| number \| boolean }` containing attribute names and values to be used for matching trace spans. If a string value starts with `#`, it will be treated as a case-insensitive regular expression. |
| `name` | `string` | String value for matching one or more spans by name. If the string value starts with `#`, it will be treated as a case-insensitive regular expression. |
| `sample` | `number` | Specifies the rate to be used by the default trace sampler for sampling the matched trace spans. Accepts as a value a number greater than `0` and less than or equal to `1` denoting the [probability](https://opentelemetry.io/docs/specs/otel/trace/tracestate-probability-sampling-experimental/) percentage for sampling a trace (e.g., a value of `0.15` means that all trace spans matched by any of the rules will have a 15% probability of being sampled). Ignored when a custom trace sampler is used. |

### PostgreSQLHostConfig

Configuration for connecting to PostgreSQL hosts when using a PostgreSQL database.

| Property | Type | Description |
|----------|------|-------------|
| `connection` | `string` | **Required.** PostgreSQL connection URL. |
| `dbName` | `string` | Database name for the PostgreSQL connection URL. Defaults to `"test"`. |
| `failoverTimeout` | `number` | Interval in milliseconds to wait for a response from the PostgreSQL host before proceeding to the next one. Defaults to `2000`. |
| `isReadOnly` | `boolean` | If `true`, **io.Manager** won't attempt to execute write operations on this host. Defaults to `false`. |
| `native` | `boolean` | If `true`, will use the [`pg-native`](https://www.npmjs.com/package/pg-native) implementation. Defaults to `false`. <br> ⚠️ *Note that `pg-native` isn't a dependency of the `@interopio/manager` package and must be installed separately.* |
| `poolConfig` | `object` | [Knex.js](https://knexjs.org/) pool configuration. For more details, see the [official Knex.js documentation](https://knexjs.org/guide/#pool). |
| `schemaName` | `string` | PostgreSQL schema name. Defaults to `"public"`. |

### PostgreSQLStoreConfig

Configuration for using a [PostgreSQL database](https://docs.interop.io/manager/databases/postgresql/index.md) as a data store for the **io.Manager** Server.

| Property | Type | Description |
|----------|------|-------------|
| `connection` | `string` | **Required.** PostgreSQL connection URL. <br> ⚠️ *Note that this property is required only if the `hosts` property isn't populated.* |
| `createDatabaseAndTables` | `boolean` | If `true` (default), will automatically create and initialize the database and the tables necessary for **io.Manager**. Set to `false` if you want to do this separately. For more details on database schema creation and migration, see the [Database Schema](https://docs.interop.io/manager/databases/postgresql/index.md#database_schema) section. |
| `dbName` | `string` | Database name for the PostgreSQL connection URL. Defaults to `"test"`. |
| `hosts` | `object[]` | List of PostgreSQL hosts to which to connect. Hosts will be tried in the order they are provided. <br> ⚠️ *Note that if this property is populated, the connection-related properties of the `store` object will be ignored in favor of the host definitions, and automatic schema creation or migration won't be performed. The `transactionRetries`, `transactionRetryDelayMs`, and `transactionIsolation` properties still apply.* |
| `migrationRetries` | `number` | How many times store initialization - creating the database, creating the schema and running the migration scripts - is retried after a transient failure, such as another server instance initializing the same database concurrently. The error of the final attempt is propagated. Defaults to `3`. *Available since **io.Manager** 4.0.* |
| `migrationRetryDelayMs` | `number` | The delay in milliseconds between store initialization retry attempts. Defaults to `1000`. *Available since **io.Manager** 4.0.* |
| `native` | `boolean` | If `true`, will use the [`pg-native`](https://www.npmjs.com/package/pg-native) implementation. Defaults to `false`. <br> ⚠️ *Note that `pg-native` isn't a dependency of the `@interopio/manager` package and must be installed separately.* |
| `poolConfig` | `object` | [Knex.js](https://knexjs.org/) pool configuration. For more details, see the [official Knex.js documentation](https://knexjs.org/guide/#pool). |
| `schemaName` | `string` | PostgreSQL schema name. Defaults to `"public"`. |
| `transactionIsolation` | `"database-default"` \| `"read-committed"` \| `"repeatable-read"` \| `"serializable"` | The isolation level for the database transactions the server opens. `"database-default"` leaves the database's own default isolation level in effect, including a default customized with `default_transaction_isolation`. Defaults to `"database-default"`. *Available since **io.Manager** 4.0.* |
| `transactionRetries` | `number` | How many times a database transaction, or a standalone read, is re-run after a transient failure. Set to `0` to disable the retry. Defaults to `3`. *Available since **io.Manager** 4.0.* |
| `transactionRetryDelayMs` | `number` | The base delay in milliseconds between retry attempts. The actual delay is randomized and increases with each retry. Defaults to `100`. *Available since **io.Manager** 4.0.* |
| `type` | `"postgresql"` | **Required.** Type of the data store. Must be set to `"postgresql"` when using a PostgreSQL database. |

### PurgeConfig

Configuration for the [database size management](https://docs.interop.io/manager/databases/overview/index.md#database_size_management).

| Property | Type | Description |
|----------|------|-------------|
| `enabled` | `boolean` | If `true` (default), will enable data purging. |
| `purgeAtStartupEnabled` | `boolean` | If `true` (default), the data purging operation will be performed on startup of the **io.Manager** Server. *Available since **io.Manager** Server 1.7.* |
| `purgeAuditLogsAfterDays` | `number` | Number of days after which an audit log becomes eligible for purging. Set to `-1` to disable purging of audit logs. Defaults to `90`. |
| `purgeCommandsAfterDays` | `number` | Number of days after which an executed command and the respective command result become eligible for purging. Set to `-1` to disable purging of commands and command results. Defaults to `90`. *Available since **io.Manager** Server 2.0.* |
| `purgeCrashesAfterDays` | `number` | Number of days after which a crash report becomes eligible for purging. Set to `-1` to disable purging of crash reports. Defaults to `90`. |
| `purgeFeedbackReportsAfterDays` | `number` | Number of days after which a feedback report becomes eligible for purging. Set to `-1` to disable purging of feedback reports. Defaults to `90`. |
| `purgeInactiveSessionsAfterDays` | `number` | Number of days of inactivity after which a session becomes eligible for purging. All machine entries that aren't referenced by any sessions will also be purged. Set to `-1` to disable purging of sessions and machine information. Defaults to `90`. |
| `scheduledTaskInterval` | `number` | Interval in milliseconds at which to run the periodic data purging operation. Defaults to `86400000` (1 day). *Available since **io.Manager** Server 2.0.* |

### SchemasConfig

Schema validation configuration.

| Property | Type | Description |
|----------|------|-------------|
| `path` | `string` | Custom path to a schema definition. If provided, will be used as a base path for schema definition lookup. Defaults to `"./schemas"` (if such directory exists). |

### SentryMonitoringConfig

Configuration for using Sentry as a monitoring tool in the **io.Manager** Server.

| Property | Type | Description |
|----------|------|-------------|
| `sentryClient` | `object` | Accepts a `SentryClient` object as a value. Use to provide an already initialized Sentry client. Useful if you want to initialize Sentry manually before starting **io.Manager**. For more details, see the [Sentry for Node.js](https://docs.sentry.io/platforms/javascript/guides/node/) guide in the official Sentry documentation. *Available since **io.Manager** Server 2.0.* |
| `sentryOptions` | `object` | Accepts a `SentryOptions` object as a value. Passed to the `Sentry.init()` method. Ignored when a Sentry client is provided via the `sentryClient` property. For more details, see the [Configuration Options](https://docs.sentry.io/platforms/node/configuration/options/) section in the official Sentry documentation. *Available since **io.Manager** Server 2.0.* |
| `type` | `string` | **Required.** Monitoring tool type. Must be set to `"sentry"` when using Sentry as a monitoring tool. |

> ⚠️ *Note that you can provide either `sentryClient` or `sentryOptions`, but not both.*

### SessionsConfig

Configuration for the sessions between the io.Connect platform clients and the **io.Manager** Server.

| Property | Type | Description |
|----------|------|-------------|
| `inactiveSessionTimeoutInSeconds` | `number` | Interval in seconds after which an io.Connect platform client session is considered inactive. Sessions are considered active if the connected platform has fetched data within the specified timeout. Must be set to the same value as the `"fetchInterval"` property of the `"server"` object in the **io.Connect Desktop** [platform configuration](https://docs.interop.io/manager/configuration/platform/index.md#ioconnect_desktop), or the `fetchInterval` property of the `manager` object in the **io.Connect Browser** [platform configuration](https://docs.interop.io/manager/configuration/platform/index.md#ioconnect_browser) respectively. Defaults to `30`. |

### TokenConfig

Configuration for the token used for communicating with the io.Connect platform clients connected to **io.Manager**.

| Property | Type | Description |
|----------|------|-------------|
| `expiresInSeconds` | `number` | JWT expiry time in seconds. Defaults to `2592000` (30 days). |
| `secret` | `string` | **Required.** A symmetric key for signing a JWT. The JWT represents an ongoing session with an io.Connect platform client. |

### WebServerConfig

HTTP/HTTPS protocol configuration for the **io.Manager** Server.

| Property | Type | Description |
|----------|------|-------------|
| `options` | `object` | Server options passed to the Node.js HTTP/HTTPS server. Accepts an `HttpServerOptions` object (server [options](https://nodejs.org/api/http.html#httpcreateserveroptions-requestlistener) from the Node.js `http` module) or an `HttpsServerOptions` object (server [options](https://nodejs.org/api/https.html#httpscreateserveroptions-requestlistener) from the Node.js `https` module) as a value depending on the value of the `secure` property. |
| `secure` | `boolean` | **Required.** If `true`, the server will use HTTPS protocol. If `false`, the server will use the HTTP protocol. |

## Environment Variables

The **io.Manager** Server can be configured via environment variables. Environment variables are taken into account only if you don't pass a [configuration object](#configuration_object) to the `start()` method of the `@interopio/manager` library. The **io.Manager** Server will attempt to read environment variables from `.env` and `.env.local` files if such exist in the current working directory. The settings specified in a `.env.local` file will override the settings in a `.env` file.

> ⚠️ *Note that using environment variables is the only supported option for configuring the **io.Manager** Server when using Docker images to deploy **io.Manager** (e.g., when using the [basic scenario](https://github.com/InteropIO/manager-examples/tree/main/manager-template/1-basic) via the [template repository](https://docs.interop.io/manager/deployment/index.md#template_repository) approach).*

The following example demonstrates basic configuration for the **io.Manager** Server via environment variables:

```ini
# Name for the io.Manager Server. Used for logging purposes.
API_NAME=my-server
# Port on which the io.Manager Server will listen.
API_PORT=4242
# Base path for the io.Manager REST API.
API_BASE=api

# It's required to provide a valid license key for io.Manager.
API_LICENSE_KEY=my-license-key

# It's required to provide settings for one of the supported database stores to use.
API_STORE_TYPE=mongo
API_STORE_MONGO=mongodb://localhost:27017/my_db

# It's required to provide settings for the token used for communication with the platform clients.
# Symmetric key for signing a JWT.
API_TOKEN_SECRET=my-secret

# Settings for Basic authentication.
API_AUTH_METHOD=basic
# List of users in the `user-id:password` format. The specified users will be created in the database,
# will be granted administrative privileges, and will have access to the Admin UI.
API_AUTH_METHOD_BASIC_USERS=["admin:admin"]

# Configuring the user session length for the Admin UI.
API_AUTH_METHOD_BASIC_SESSION_LIFETIME=7200
# Session cookies are enabled by default when using Basic authentication,
# so it's required to specify CORS options.
API_CORS_OPTIONS={"credentials": true, "origin": "http://localhost:3000"}
```

### Primary Configuration

Environment variables for the primary configuration of the **io.Manager** Server.

| Environment Variable | Description |
|----------------------|-------------|
| `API_ADVANCED_LAYOUTS_ENABLED` | If `true`, the **io.Manager** Server serves advanced Layouts to io.Connect platform clients instead of legacy Layouts. Defaults to `false`. *Available since **io.Manager** 4.0 & **io.Connect Desktop** 10.5 (unreleased).* |
| `API_ADVANCED_LAYOUTS_MIGRATION_CLAIM_STALENESS` | Time in milliseconds after which an abandoned Layout migration run may be taken over by a new run. Must be a finite number greater than zero. Defaults to `600000` (10 minutes). *Available since **io.Manager** 4.0 & **io.Connect Desktop** 10.5 (unreleased).* |
| `API_ADVANCED_LAYOUTS_MIGRATION_PAGE_SIZE` | Number of legacy Layouts a migration run reads and writes at a time. Lower values reduce the run's memory use and higher values reduce the number of database round trips. Must be an integer greater than zero. Defaults to `1000`. *Available since **io.Manager** 4.0 & **io.Connect Desktop** 10.5 (unreleased).* |
| `API_ADVANCED_LAYOUTS_SHARING_REQUIRED_GROUP` | Name of a group whose members are allowed to save advanced Layouts with `accessLevel` set to `shared` or `public`. Membership in nested groups is honored. Saving advanced Layouts with `accessLevel` set to `private` is never restricted. When omitted, any authenticated user may share or publish advanced Layouts. *Available since **io.Manager** 4.0 & **io.Connect Desktop** 10.5 (unreleased).* |
| `API_APP_ACCESS_LOG_FILE` | Path to the access log file. Defaults to `logs/access.log`. |
| `API_APP_LOG_FILE` | Path to the app log file. Defaults to `logs/application.log`. |
| `API_BASE` | Base path for the API that will be added to the **io.Manager** Server origin. If you set this to `api`, the server will listen on `<origin>/api` (e.g., `http://localhost:4242/api`). Defaults to `""`. |
| `API_CORS_OPTIONS` | CORS options. Required when session cookies are enabled via the `API_AUTH_METHOD_BASIC_USE_SESSION_COOKIE` environment variable. *Available since **io.Manager** Server 2.0.* |
| `API_EXPOSE_STOP` | If `true`, will expose a `GET /<base>/stop` endpoint that shuts down the **io.Manager** Server. Defaults to `false`. |
| `API_INTERCEPT_PROCESS_SIGNALS` | If `true`, **io.Manager** will listen for the following signals: `SIGINT`, `SIGTERM`, `SIGHUP`, `SIGBREAK`, and `SIGQUIT`. When any of these signals has been received, **io.Manager** will shut itself down gracefully. Defaults to `false`. *Available since **io.Manager** Server 2.0.* |
| `API_LICENSE_KEY` | **Required.** Valid [license key](https://docs.interop.io/manager/requirements/index.md#licensing) for **io.Manager**. |
| `API_LOG_LEVEL` | Logging level. Defaults to `info`. *Available since **io.Manager** Server 2.0.* |
| `API_NAME` | Name for the **io.Manager** Server. Used for logging purposes. Defaults to `local`. |
| `API_PORT` | Port to use for the **io.Manager** Server. If set to a string that can't be converted to a number, it will be treated as a path. Defaults to `4356`. |
| `API_SCHEMAS_PATH` | Custom path to a schema definition. If provided, will be used as a base path for schema definition lookup. Defaults to `./schemas`. |
| `API_SKIP_PROCESS_EXIT_ON_STOP` | If `true`, won't call `process.exit()` on shutdown. Defaults to `true`. |
| `API_TOKEN_EXPIRES_IN` | JWT expiry time in seconds. Defaults to `2592000` (30 days). |
| `API_TOKEN_SECRET` | **Required.** A symmetric key for signing a JWT. The JWT represents an ongoing session with an io.Connect platform client. |

### Authentication

Environment variables for configuring the [authentication](https://docs.interop.io/manager/authentication/overview/index.md) mechanism to be used by the **io.Manager** Server.

The following environment variables are used for all authentication mechanisms:

| Environment Variable | Description |
|----------------------|-------------|
| `API_AUTH_EXCLUSIVE_USERS` | List of users that will be assigned to the `GLUE42_SERVER_ADMIN` group, which grants unrestricted access to the Admin UI and to every protected endpoint of the **io.Manager** Server. The users must already exist in the database. |
| `API_AUTH_EXTRA_GROUPS` | JSON-encoded array of custom group definitions. Each entry must have a `name`, and may have an `expandsTo` array and a `description`. The supplied entries are merged with the built-in default groups, which take precedence over an entry with the same `name`. For the full list of available permission groups and default group mappings, see [Authorization](https://docs.interop.io/manager/authorization/index.md). *Available since **io.Manager** 4.0.* |
| `API_AUTH_METHOD` | Type of the authentication mechanism. Set this to `none`, `basic`, `auth0`, or `okta` to use one of the supported authentication mechanisms. Defaults to `none`. |
| `API_AUTH_TIMEOUT` | Interval in milliseconds to wait for the authentication process request to complete before rejecting it. Defaults to `120000`. *Available since **io.Manager** Server 2.0.* |
| `API_USERNAME_CASE_SENSITIVE` | If `true`, username comparison will be case-sensitive. Defaults to `false`. |

#### None

Environment variables for configuring [None](https://docs.interop.io/manager/authentication/none/index.md) authentication.

| Environment Variable | Description |
|----------------------|-------------|
| `API_AUTH_NONE_ALLOW_ONLY_KNOWN_USERS` | If `true`, only the users that are already in the **io.Manager** database will be allowed to connect. If `false`, all users will be allowed to connect and new users will be automatically added to the database. Defaults to `false`. |

#### Basic

Environment variables for configuring [Basic](https://docs.interop.io/manager/authentication/basic/index.md) authentication.

| Environment Variable | Description |
|----------------------|-------------|
| `API_AUTH_METHOD_BASIC_SESSION_LIFETIME` | Interval in seconds at which the session will expire and the user will be logged out of the **io.Manager** Admin UI. Valid only if `API_AUTH_METHOD_BASIC_USE_SESSION_COOKIE` is set to `true` and the CORS options are configured properly via the `API_CORS_OPTIONS` environment variable. Defaults to `3600`. *Available since **io.Manager** Server 2.1.* |
| `API_AUTH_METHOD_BASIC_USE_SESSION_COOKIE` | If `true` (default), **io.Manager** will use a signed JWT stored in a session cookie to manage the Admin UI user sessions. Set to `false` to disable session cookies. If session cookies are enabled, it's required to specify CORS options via the `API_CORS_OPTIONS` environment variable. *Available since **io.Manager** Server 2.1.* |
| `API_AUTH_METHOD_BASIC_USERS` | List of predefined users that will be created in the database and will be assigned to the `GLUE42_SERVER_ADMIN` group, which grants unrestricted access to the Admin UI and to every protected endpoint of the **io.Manager** Server. Accepts an array of strings in the format `user-id:password`. |

#### Auth0

Environment variables for configuring [Auth0](https://docs.interop.io/manager/authentication/auth0/index.md) authentication.

| Environment Variable | Description |
|----------------------|-------------|
| `API_AUTH_AUTH0_AUDIENCE` | URL pointing to the resource that will consume the access token. |
| `API_AUTH_AUTH0_ISSUER` | URL pointing to the issuer to be used for validation of access tokens. Unnecessary if `API_AUTH_AUTH0_ISSUER_BASE_URL` is provided. |
| `API_AUTH_AUTH0_ISSUER_BASE_URL` | Base URL of the issuer to be used for validation of access tokens. Unnecessary if `API_AUTH_AUTH0_ISSUER` and `API_AUTH_AUTH0_JWKSURI` are provided. *Available since **io.Manager** Server 1.7.* |
| `API_AUTH_AUTH0_JWKSURI` | URL pointing to a JSON Web Key Set. Unnecessary if `API_AUTH_AUTH0_ISSUER_BASE_URL` is provided. |

> ⚠️ *Note that it's required to provide either `API_AUTH_AUTH0_ISSUER_BASE_URL` or `API_AUTH_AUTH0_ISSUER` and `API_AUTH_AUTH0_JWKSURI` together.*

#### Okta

Environment variables for configuring [Okta](https://docs.interop.io/manager/authentication/okta/index.md) authentication.

| Environment Variable | Description |
|----------------------|-------------|
| `API_AUTH_OKTA_AUDIENCES` | **Required.** Comma-delimited string with URLs pointing to the resources that will consume the access token. |
| `API_AUTH_OKTA_CLIENT_ID` | Okta client ID. |
| `API_AUTH_OKTA_GROUPS_CLAIMS_NAME` | The name of the JWT claim from which to retrieve the Okta user groups. Defaults to `groups`. |
| `API_AUTH_OKTA_ISSUER` | **Required.** URL pointing to the issuer to be used for validation of access tokens. |
| `API_AUTH_OKTA_JWKS_URI` | URL pointing to a JSON Web Key Set. |

### Databases

Environment variables for configuring the database store to be used by the **io.Manager** Server.

The following environment variables are used for all database store types:

| Environment Variable | Description |
|----------------------|-------------|
| `API_STORE_TYPE` | **Required.** Type of the database. Set to `mongo`, `postgresql`, or `mssql` to use one of the supported databases. |

#### MongoDB

Environment variables for configuring a [MongoDB database](https://docs.interop.io/manager/databases/mongo/index.md) as a data store for the **io.Manager** Server.

The following environment variables are available when `API_STORE_TYPE` is set to `mongo`:

| Environment Variable | Description |
|----------------------|-------------|
| `API_STORE_MONGO` | **Required.** MongoDB connection URL. |
| `API_STORE_MONGO_TRANSACTIONS` | Whether to use MongoDB multi-document transactions, which require MongoDB to be deployed as a replica set or a sharded cluster. Set to `required` to prevent the server from starting when the MongoDB deployment doesn't support transactions, or to `disabled` to never use transactions. Defaults to `autodetect` - transactions are used when the deployment supports them, otherwise the server logs a warning and runs without transactions. *Available since **io.Manager** 4.0.* |

#### PostgreSQL

Environment variables for configuring a [PostgreSQL database](https://docs.interop.io/manager/databases/postgresql/index.md) as a data store for the **io.Manager** Server.

The following environment variables are available when `API_STORE_TYPE` is set to `postgresql`:

| Environment Variable | Description |
|----------------------|-------------|
| `API_STORE_POSTGRESQL` | **Required.** PostgreSQL connection URL. |
| `API_STORE_POSTGRESQL_CREATE_DB` | If `true` (default), will automatically create and initialize the database and the tables necessary for **io.Manager**. Set to `false` if you want to do this separately. For more details on database schema creation and migration, see the [Databases > PostgreSQL > Database Schema](https://docs.interop.io/manager/databases/postgresql/index.md#database_schema) section. |
| `API_STORE_POSTGRESQL_DB_NAME` | **Required.** Database name for the PostgreSQL connection URL. |
| `API_STORE_POSTGRESQL_MIGRATION_RETRIES` | How many times store initialization - creating the database, creating the schema and running the migration scripts - is retried after a transient failure, such as another server instance initializing the same database concurrently. The error of the final attempt is propagated. Defaults to `3`. *Available since **io.Manager** 4.0.* |
| `API_STORE_POSTGRESQL_MIGRATION_RETRY_DELAY_MS` | The delay in milliseconds between store initialization retry attempts. Defaults to `1000`. *Available since **io.Manager** 4.0.* |
| `API_STORE_POSTGRESQL_NATIVE_PG_DRIVER` | If `true`, will use the [`pg-native`](https://www.npmjs.com/package/pg-native) implementation. Defaults to `false`. <br> ⚠️ *Note that `pg-native` isn't a dependency of the `@interopio/manager` package and must be installed separately.* |
| `API_STORE_POSTGRESQL_SCHEMA_NAME` | PostgreSQL schema name. Defaults to `public`. |
| `API_STORE_POSTGRESQL_TRANSACTION_ISOLATION` | The isolation level for the database transactions the server opens. Accepts `database-default`, `read-committed`, `repeatable-read`, or `serializable` as a value. `database-default` leaves the database's own default isolation level in effect, including a default customized with `default_transaction_isolation`. Defaults to `database-default`. *Available since **io.Manager** 4.0.* |
| `API_STORE_POSTGRESQL_TRANSACTION_RETRIES` | How many times a database transaction, or a standalone read, is re-run after a transient failure. Set to `0` to disable the retry. Defaults to `3`. *Available since **io.Manager** 4.0.* |
| `API_STORE_POSTGRESQL_TRANSACTION_RETRY_DELAY_MS` | The base delay in milliseconds between retry attempts. The actual delay is randomized and increases with each retry. Defaults to `100`. *Available since **io.Manager** 4.0.* |

#### Microsoft SQL Server

Environment variables for configuring a [Microsoft SQL Server database](https://docs.interop.io/manager/databases/microsoft-sql/index.md) as a data store for the **io.Manager** Server.

The following environment variables are available when `API_STORE_TYPE` is set to `mssql`:

| Environment Variable | Description |
|----------------------|-------------|
| `API_STORE_MSSQL_CREATE_DB` | If `true` (default), will automatically create and initialize the database and the tables necessary for **io.Manager**. Set to `false` if you want to do this separately. For more details on database schema creation and migration, see the [Databases > Microsoft SQL Server > Database Schema](https://docs.interop.io/manager/databases/microsoft-sql/index.md#database_schema) section. |
| `API_STORE_MSSQL_DB_NAME` | **Required.** Database name for the Microsoft SQL Server connection URL. |
| `API_STORE_MSSQL_DOMAIN` | Windows domain for login. |
| `API_STORE_MSSQL_MIGRATION_RETRIES` | How many times store initialization - creating the database, creating the schema and running the migration scripts - is retried after a transient failure, such as another server instance initializing the same database concurrently. The error of the final attempt is propagated. Defaults to `3`. *Available since **io.Manager** 4.0.* |
| `API_STORE_MSSQL_MIGRATION_RETRY_DELAY_MS` | The delay in milliseconds between store initialization retry attempts. Defaults to `1000`. *Available since **io.Manager** 4.0.* |
| `API_STORE_MSSQL_PASSWORD` | **Required.** Password for authentication. |
| `API_STORE_MSSQL_PORT` | Port for the Microsoft SQL Server connection URL. |
| `API_STORE_MSSQL_SERVER` | Host for the Microsoft SQL Server connection URL. |
| `API_STORE_MSSQL_TRANSACTION_ISOLATION` | The isolation level for the database transactions the server opens. Accepts `database-default`, `read-committed`, `snapshot`, or `serializable` as a value. `database-default` leaves the database's own default isolation level in effect. Defaults to `database-default`. <br> ⚠️ *Note that `snapshot` requires the database to have `ALLOW_SNAPSHOT_ISOLATION` enabled - otherwise, the server won't start.* <br> *Available since **io.Manager** 4.0.* |
| `API_STORE_MSSQL_TRANSACTION_RETRIES` | How many times a database transaction, or a standalone read, is re-run after a transient failure. Set to `0` to disable the retry. Defaults to `3`. *Available since **io.Manager** 4.0.* |
| `API_STORE_MSSQL_TRANSACTION_RETRY_DELAY_MS` | The base delay in milliseconds between retry attempts. The actual delay is randomized and increases with each retry. Defaults to `100`. *Available since **io.Manager** 4.0.* |
| `API_STORE_MSSQL_USERNAME` | **Required.** Username for authentication. |

### Data Purge

Environment variables for configuring the [database size management](https://docs.interop.io/manager/databases/overview/index.md#database_size_management).

| Environment Variable | Description |
|----------------------|-------------|
| `API_PURGE_AT_STARTUP_ENABLED` | If `true` (default), the data purging operation will be performed on startup of the **io.Manager** Server. *Available since **io.Manager** Server 1.7.* |
| `API_PURGE_AUDIT_LOGS_AFTER_DAYS` | Number of days after which an audit log becomes eligible for purging. Set to `-1` to disable purging of audit logs. Defaults to `90`. |
| `API_PURGE_COMMANDS_AFTER_DAYS` | Number of days after which an executed command and the respective command result become eligible for purging. Set to `-1` to disable purging of commands and command results. Defaults to `90`. *Available since **io.Manager** Server 2.0.* |
| `API_PURGE_CRASH_REPORTS_AFTER_DAYS` | Number of days after which a crash report becomes eligible for purging. Set to `-1` to disable purging of crash reports. Defaults to `90`. |
| `API_PURGE_ENABLED` | If `true` (default), will enable data purging. |
| `API_PURGE_FEEDBACK_REPORTS_AFTER_DAYS` | Number of days after which a feedback report becomes eligible for purging. Set to `-1` to disable purging of feedback reports. Defaults to `90`. |
| `API_PURGE_INACTIVE_SESSIONS_AFTER_DAYS` | Number of days of inactivity after which a session becomes eligible for purging. All machine entries that aren't referenced by any sessions will also be purged. Set to `-1` to disable purging of sessions and machine information. Defaults to `90`. |
| `API_PURGE_SCHEDULED_TASK_INTERVAL` | Interval in milliseconds at which to run the periodic data purging operation. Defaults to `86400000` (1 day). *Available since **io.Manager** Server 2.0.* |

### Health Endpoints

Environment variables for configuring the [health check](https://docs.interop.io/manager/deployment/index.md#health_checks) endpoints exposed by the **io.Manager** Server.

| Environment Variable | Description |
|------------------------|-------------|
| `API_HEALTH_ENDPOINTS_CUSTOM_DB_CONNECTIVITY_HEALTHCHECK_ROUTE` | If present, an additional database health check endpoint will be available on the specified route. The health check behaves exactly the same as when invoking the `GET /db-connectivity` endpoint. *Available since **io.Manager** Server 1.8.* |
| `API_HEALTH_ENDPOINTS_CUSTOM_DB_CONNECTIVITY_STATUS` | The string that the database connectivity health check will return as a successful response. Defaults to `OK`. *Available since **io.Manager** Server 1.8.1.* |
| `API_HEALTH_ENDPOINTS_CUSTOM_HEALTHCHECK_ROUTE` | If present, an additional health check endpoint will be available on the specified route. The health check behaves exactly the same as when invoking the `GET /` endpoint. *Available since **io.Manager** Server 1.8.* |
| `API_HEALTH_ENDPOINTS_CUSTOM_HEALTHCHECK_STATUS` | String that will be passed as a value to the `"status"` field in the health check response. Defaults to `OK`. *Available since **io.Manager** Server 1.8.1.* |
| `API_HEALTH_ENDPOINTS_DB_CONNECTIVITY_QUERY` | SQL query executed by the database connectivity health check when using PostgreSQL or Microsoft SQL Server. Defaults to `select 1`. *Available since **io.Manager** 4.0.* |
| `API_HEALTH_ENDPOINTS_DB_CONNECTIVITY_TIMEOUT` | Interval in milliseconds to wait for a response from the database when performing a database connectivity health check. Defaults to `2000`. |

> ⚠️ *Note that when providing custom health check routes via the `API_HEALTH_ENDPOINTS_CUSTOM_HEALTHCHECK_ROUTE` and the `API_HEALTH_ENDPOINTS_CUSTOM_DB_CONNECTIVITY_HEALTHCHECK_ROUTE` environment variables, the base API path specified in the `API_BASE` environment variable won't be taken into account.*

### Monitoring

Environment variables for configuring the monitoring tool to be used by the **io.Manager** Server.

| Environment Variable | Description |
|------------------------|-------------|
| `API_MONITORING` | Monitoring tool to be used. Use `sentry` to enable Sentry monitoring. Defaults to `none`. |
| `API_MONITORING_SENTRY_DSN` | Sentry DSN connection string. Required when using Sentry monitoring. *Available since **io.Manager** Server 1.7.* |

### OpenAPI / Swagger UI

Available since io.Manager Server 2.0

Environment variables for configuring the [OpenAPI](https://docs.interop.io/manager/open-api-support/index.md) support provided by **io.Manager**.

| Environment Variable | Description |
|------------------------|-------------|
| `API_OPEN_API_ENABLE_SWAGGER_UI` | If `true` (default), **io.Manager** will serve the Swagger UI.  |
| `API_OPEN_API_SWAGGER_UI_ROUTE` | Route on which **io.Manager** will serve the Swagger UI. Defaults to `swagger`. |

### OpenTelemetry

Available since io.Manager Server 1.7

Environment variables for configuring the [OpenTelemetry](https://docs.interop.io/manager/opentelemetry-support/overview/index.md) support provided by **io.Manager**.

The following environment variables are available for configuring the general OpenTelemetry settings:

| Environment Variable | Description |
|----------------------|-------------|
| `API_OTEL_DIAGNOSTIC_LOGGER_LEVEL` | Logging level for the OpenTelemetry diagnostic logger. Defaults to `WARN`. |
| `API_OTEL_ENABLED` | If `true`, will enable publishing OpenTelemetry data. Defaults to `false`. |
| `API_OTEL_RESOURCE_DEPLOYMENT_ENVIRONMENT` | Value for the [`deployment.environment.name`](https://opentelemetry.io/docs/specs/semconv/attributes-registry/deployment/#deployment-environment-name) resource attribute. Name of the deployment environment. |
| `API_OTEL_RESOURCE_INSTANCE_ID` | Value for the [`service.instance.id`](https://opentelemetry.io/docs/specs/semconv/attributes-registry/service/#service-instance-id) resource attribute. Must be unique for each `service.namespace` and `service.name` pair. The instance ID helps to distinguish instances of the same service that exist at the same time (e.g., instances of a horizontally scaled service). |
| `API_OTEL_RESOURCE_SERVICE_NAME` | Value for the [`service.name`](https://opentelemetry.io/docs/specs/semconv/attributes-registry/service/#service-name) resource attribute. Logical name of the service. Must be the same for all instances of horizontally scaled services. Required if `API_OTEL_ENABLED` is set to `true`. |
| `API_OTEL_RESOURCE_SERVICE_NAMESPACE` | Value for the [`service.namespace`](https://opentelemetry.io/docs/specs/semconv/attributes-registry/service/#service-namespace) resource attribute. Namespace for the `service.name` attribute. This should be a value that will help distinguish a group of services semantically from other groups of services - e.g., the name of the team that owns the group of services. The value of each `service.name` attribute within the same namespace must be unique. If a `service.namespace` attribute isn't specified for the resource, then the `service.name` attribute must be unique among all services without an explicitly defined namespace (an unspecified namespace is simply one more valid namespace). A zero-length string value for a namespace equals an unspecified namespace. |

#### Metrics

Environment variables for publishing OpenTelemetry [metrics](https://docs.interop.io/manager/opentelemetry-support/metrics/index.md).

| Environment Variable | Description |
|----------------------|-------------|
| `API_OTEL_METRICS_DEFAULT_METRICS_ENABLED` | If `true` (default), will enable publishing of all [available metrics](https://docs.interop.io/manager/opentelemetry-support/metrics/index.md#available_metrics). |
| `API_OTEL_METRICS_ENABLED` | If `true`, will enable publishing OpenTelemetry metrics. Defaults to `false`. |
| `API_OTEL_METRICS_PUBLISH_INTERVAL` | Interval in milliseconds at which the metrics reader will collect metrics. Passed to the [`PeriodicExportingMetricReader`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_sdk-metrics.PeriodicExportingMetricReader.html) constructor. This is the default metrics reader used by the **io.Manager** Server. Ignored when a [custom metrics reader](https://docs.interop.io/manager/opentelemetry-support/metrics/index.md#customization-metrics_reader) is used. Defaults to `5000`. |
| `API_OTEL_METRICS_URL` | URL pointing to an [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) where the generated metrics will be sent via HTTP. Passed to the [`OTLPMetricExporter`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_exporter-metrics-otlp-http.OTLPMetricExporter.html) constructor. This is the default metrics exporter used by the **io.Manager** Server. Required if using the default metrics exporter and metrics reader. Ignored when either a [custom metrics exporter](https://docs.interop.io/manager/opentelemetry-support/metrics/index.md#customization-metrics_exporter) or a custom metrics reader is used. |

#### Metric Definition

Environment variables for configuring the [available metrics](https://docs.interop.io/manager/opentelemetry-support/metrics/index.md#available_metrics) published by **io.Manager**.

The following environment variables are available for configuring the `"http.server.active_requests"` metric:

| Environment Variable | Description |
|----------------------|-------------|
| `API_OTEL_METRICS_DEFINITIONS_HTTP_ACTIVE_REQUESTS_DESCRIPTION` | Description for the metric. Defaults to `"Number of active HTTP server requests."`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_ACTIVE_REQUESTS_ENABLED` | If `true`, will enable publishing the metric. Defaults to the value of the `API_OTEL_METRICS_DEFAULT_METRICS_ENABLED` environment variable. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_ACTIVE_REQUESTS_NAME` | Name for the metric. May be used in visualization tools. Defaults to `http.server.active_requests`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_ACTIVE_REQUESTS_UNIT` | Unit for the metric values. Defaults to `{request}`. |

The following environment variables are available for configuring the `"http.server.request.body.size"` metric:

| Environment Variable | Description |
|----------------------|-------------|
| `API_OTEL_METRICS_DEFINITIONS_HTTP_REQUEST_BODY_SIZE_BUCKETS` | Histogram bucket boundaries. Defaults to `[1024, 10240, 102400, 1048576, 10485760, 104857600]`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_REQUEST_BODY_SIZE_DESCRIPTION` | Description for the metric. Defaults to `"Size of HTTP server request bodies."`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_REQUEST_BODY_SIZE_ENABLED` | If `true`, will enable publishing the metric. Defaults to the value of the `API_OTEL_METRICS_DEFAULT_METRICS_ENABLED` environment variable. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_REQUEST_BODY_SIZE_NAME` | Name for the metric. May be used in visualization tools. Defaults to `http.server.request.body.size`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_REQUEST_BODY_SIZE_UNIT` | Unit for the metric values. Defaults to `By`. |

The following environment variables are available for configuring the `"http.server.request.duration"` metric:

| Environment Variable | Description |
|----------------------|-------------|
| `API_OTEL_METRICS_DEFINITIONS_HTTP_REQUEST_DURATION_BUCKETS` | Histogram bucket boundaries. Defaults to `[0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10]`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_REQUEST_DURATION_DESCRIPTION` | Description for the metric. Defaults to `"Duration of HTTP server requests."`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_REQUEST_DURATION_ENABLED` | If `true`, will enable publishing the metric. Defaults to the value of the `API_OTEL_METRICS_DEFAULT_METRICS_ENABLED` environment variable. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_REQUEST_DURATION_NAME` | Name for the metric. May be used in visualization tools. Defaults to `http.server.request.duration`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_REQUEST_DURATION_UNIT` | Unit for the metric values. Defaults to `s`. |

The following environment variables are available for configuring the `"http.server.response.body.size"` metric:

| Environment Variable | Description |
|----------------------|-------------|
| `API_OTEL_METRICS_DEFINITIONS_HTTP_RESPONSE_BODY_SIZE_BUCKETS` | Histogram bucket boundaries. Defaults to `[1024, 10240, 102400, 1048576, 10485760, 104857600]`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_RESPONSE_BODY_SIZE_DESCRIPTION` | Description for the metric. Defaults to `"Size of HTTP server response bodies."`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_RESPONSE_BODY_SIZE_ENABLED` | If `true`, will enable publishing the metric. Defaults to the value of the `API_OTEL_METRICS_DEFAULT_METRICS_ENABLED` environment variable. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_RESPONSE_BODY_SIZE_NAME` | Name for the metric. May be used in visualization tools. Defaults to `http.server.response.body.size`. |
| `API_OTEL_METRICS_DEFINITIONS_HTTP_RESPONSE_BODY_SIZE_UNIT` | Unit for the metric values. Defaults to `By`. |

The following environment variables are available for configuring the `"io_manager.active_sessions"` metric:

| Environment Variable | Description |
|----------------------|-------------|
| `API_OTEL_METRICS_DEFINITIONS_ACTIVE_SESSIONS_DESCRIPTION` | Description for the metric. Defaults to `"Total number of sessions that made requests in the past 'inactiveSessionTimeout' seconds."`. |
| `API_OTEL_METRICS_DEFINITIONS_ACTIVE_SESSIONS_ENABLED` | If `true`, will enable publishing the metric. Defaults to the value of the `API_OTEL_METRICS_DEFAULT_METRICS_ENABLED` environment variable. |
| `API_OTEL_METRICS_DEFINITIONS_ACTIVE_SESSIONS_INACTIVE_SESSION_TIMEOUT` | Interval in seconds after which a session is considered inactive. Must be set to the same value as the `fetchInterval` property of the `server` object in the [platform configuration](https://docs.interop.io/manager/configuration/platform/index.md) (**io.Connect Desktop** or **io.Connect Browser**) for **io.Manager**. Defaults to `30`. |
| `API_OTEL_METRICS_DEFINITIONS_ACTIVE_SESSIONS_NAME` | Name for the metric. May be used in visualization tools. Defaults to `io_manager.active_sessions`. |
| `API_OTEL_METRICS_DEFINITIONS_ACTIVE_SESSIONS_PUBLISH_AT_STARTUP_ENABLED` | If `true` (default), the **io.Manager** Server will publish the metric at startup. |
| `API_OTEL_METRICS_DEFINITIONS_ACTIVE_SESSIONS_PUBLISH_INTERVAL` | Interval in milliseconds at which to publish the metric. Defaults to `60000`. |
| `API_OTEL_METRICS_DEFINITIONS_ACTIVE_SESSIONS_UNIT` | Unit for the metric values. Defaults to `{session}`. |

#### Traces

Environment variables for publishing OpenTelemetry [traces](https://docs.interop.io/manager/opentelemetry-support/traces/index.md).

| Environment Variable | Description |
|----------------------|-------------|
| `API_OTEL_TRACES_DEFAULT_SAMPLE` | Specifies the rate to be used by the default trace sampler for sampling all traces that don't match the rules specified in the `sampling` property of the `traces` object in the [configuration object](#configuration_object) for initializing the **io.Manager** Server. Accepts as a value a number greater than `0` and less than or equal to `1` denoting the [probability](https://opentelemetry.io/docs/specs/otel/trace/tracestate-probability-sampling-experimental/) percentage for sampling trace spans (e.g., a value of `0.15` means that all trace spans not matched by any rules will have a 15% probability of being sampled). Ignored when a [custom trace sampler](https://docs.interop.io/manager/opentelemetry-support/traces/index.md#customization-trace_sampler) is used. Defaults to `1`. |
| `API_OTEL_TRACES_ENABLED` | If `true`, will enable publishing OpenTelemetry traces. Defaults to `false`. |
| `API_OTEL_TRACES_PUBLISH_INTERVAL` | Interval in milliseconds between two consecutive traces exports. Passed to the [`BatchSpanProcessor`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_sdk-trace-base.BatchSpanProcessor.html) constructor. This is the default span processor used by the **io.Manager** Server. Ignored when a [custom trace span processor](https://docs.interop.io/manager/opentelemetry-support/traces/index.md#customization-trace_span_processor) is used. Defaults to `5000`. |
| `API_OTEL_TRACES_URL` | URL pointing to an [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) where the generated traces will be sent via HTTP. Passed to the [`OTLPTraceExporter`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_exporter-trace-otlp-http.OTLPTraceExporter.html) constructor. This is the default trace exporter used by the **io.Manager** Server. Required if using the default trace exporter and trace span processor. Ignored when either a [custom trace exporter](https://docs.interop.io/manager/opentelemetry-support/traces/index.md#customization-trace_exporter) or a custom trace span processor is used. |

#### Logs

Environment variables for publishing OpenTelemetry [logs](https://docs.interop.io/manager/opentelemetry-support/logs/index.md).

| Environment Variable | Description |
|----------------------|-------------|
| `API_OTEL_LOGS_ENABLED` | If `true`, will enable publishing OpenTelemetry logs. Defaults to `false`. |
| `API_OTEL_LOGS_MAX_LEVEL` | The maximum event level to emit via the OpenTelemetry SDK. Possible values are `ALL`, `MARK`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`. Defaults to `FATAL`. |
| `API_OTEL_LOGS_MIN_LEVEL` | The minimum event level to emit via the OpenTelemetry SDK. Possible values are `ALL`, `MARK`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`. Defaults to `INFO`. |
| `API_OTEL_LOGS_PUBLISH_INTERVAL` | Interval in milliseconds between two consecutive log exports. Passed to the [`BatchLogRecordProcessor`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_sdk-logs.BatchLogRecordProcessor.html) constructor. This is the default log processor used by the **io.Manager** Server. Ignored when a [custom log processor](https://docs.interop.io/manager/opentelemetry-support/logs/index.md#customization-log_processor) is used. Defaults to `5000`. |
| `API_OTEL_LOGS_URL` | URL pointing to an [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) where the generated logs will be sent via HTTP. Passed to the [`OTLPLogExporter`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_exporter-logs-otlp-http.OTLPLogExporter.html) constructor. This is the default log exporter used by the **io.Manager** Server. Required if using the default log exporter and log processor. Ignored when either a [custom log exporter](https://docs.interop.io/manager/opentelemetry-support/logs/index.md#customization-log_exporter) or a custom log processor is used. |

### Sessions

Available since io.Manager Server 2.1

Environment variables for configuring the sessions between the io.Connect platform clients and the **io.Manager** Server.

| Environment Variable | Description |
|----------------------|-------------|
| `API_SESSIONS_INACTIVE_SESSION_TIMEOUT` | Interval in seconds after which an io.Connect platform client session is considered inactive. Sessions are considered active if the connected platform has fetched data within the specified timeout. Must be set to the same value as the `"fetchInterval"` property of the `"server"` object in the **io.Connect Desktop** [platform configuration](https://docs.interop.io/manager/configuration/platform/index.md#ioconnect_desktop), or the `fetchInterval` property of the `manager` object in the **io.Connect Browser** [platform configuration](https://docs.interop.io/manager/configuration/platform/index.md#ioconnect_browser) respectively. Defaults to `30`. |

## Server Extension Points

The **io.Manager** Server lets you customize parts of its behavior by supplying your own service implementations through the configuration object for initializing the [`@interopio/manager`](https://www.npmjs.com/package/@interopio/manager) library.

The following table describes the available extension points:

| Property | Interface | Description |
|----------|-----------|-------------|
| `audit_custom` | [`AuditService`](#configuration_object-auditservice) | Replaces the built-in audit service with your own implementation for recording and retrieving audit logs. See [Custom Audit Service](#server_extension_points-custom_audit_service). |
| `auth_custom` | `CustomAuthenticator` | Replaces the built-in authentication with your own implementation for authenticating users. Used only when the `auth_method` property is set to `"custom"`. |
| `groups_service` | [`GroupsService`](#configuration_object-groupsservice) | Replaces the built-in Groups service with your own implementation for storing groups and resolving the groups a user belongs to. See [Custom Groups Service](#server_extension_points-custom_groups_service). |

### Custom Audit Service

By default, the **io.Manager** Server stores the audit logs it generates in its configured [database](https://docs.interop.io/manager/databases/overview/index.md). You can replace this with your own logic by providing a custom audit service through the `audit_custom` property of the configuration object.

A custom audit service provides the methods described in the [`AuditService`](#configuration_object-auditservice) table.

Provide your implementation via the `audit_custom` property of the configuration object:

```javascript
import { start } from "@interopio/manager";

const config = {
    audit_custom: new MyAuditService()
};

const server = await start(config);
```

### Custom Authenticator

If your organization uses an authentication mechanism that **io.Manager** doesn't support out of the box, you can plug in your own implementation by providing a custom authenticator through the `auth_custom` property of the configuration object. The custom authenticator is used only when the `auth_method` property is set to `"custom"`.

A custom authenticator implements the `CustomAuthenticator` interface exported from the [`@interopio/manager`](https://www.npmjs.com/package/@interopio/manager) package. For details on the complete setup, including adding a custom login page to **io.Connect Desktop** and protecting the Admin UI, see [Authentication > Custom](https://docs.interop.io/manager/authentication/custom/index.md).

> ℹ️ *For complete examples of implementing a custom authenticator, see the [Custom Authentication](https://github.com/InteropIO/manager-examples/tree/main/auth-custom) and [Advanced Custom Authentication](https://github.com/InteropIO/manager-examples/tree/main/auth-custom-advanced) examples on GitHub.*

Provide your implementation via the `auth_custom` property of the configuration object:

```javascript
import { start } from "@interopio/manager";

const config = {
    auth_method: "custom",
    auth_custom: new MyAuthenticator()
};

const server = await start(config);
```

### Custom Groups Service

By default, the **io.Manager** Server stores groups and resolves the groups a user belongs to using its configured [database](https://docs.interop.io/manager/databases/overview/index.md). You can replace this with your own logic by providing a custom Groups service through the `groups_service` property of the configuration object.

A custom Groups service implements the `GroupsService` interface exported from the [`@interopio/manager`](https://www.npmjs.com/package/@interopio/manager) package. Its `getSupportedFeatures()` method declares which operations the implementation supports - the **io.Manager** Server invokes a group operation only when the corresponding capability flag is `true`. An implementation that only reads groups from an external source can report `false` for the operations it doesn't support and leave those methods as stubs. The `getUserGroups()` method is the one with the widest reach - the **io.Manager** Server calls it on every authenticated request when the `canGetUserGroups` capability is `true`. When it's `false`, the server never asks the service which groups a user belongs to, so any user-to-group assignments it holds are ignored.

A custom Groups service provides the methods described in the [`GroupsService`](#configuration_object-groupsservice) table.

> ℹ️ *For a complete example of implementing a custom Groups service, see the [Custom Groups Service](https://github.com/InteropIO/manager-examples/blob/main/auth-custom/io-manager-server/src/MyGroupsService.ts) example on GitHub.*

Provide your implementation via the `groups_service` property of the configuration object:

```javascript
import { start } from "@interopio/manager";

const config = {
    groups_service: new MyGroupsService()
};

const server = await start(config);
```

## Docker Image

The **io.Manager** Server can be deployed via the `manager` Docker image (e.g., when using the [basic scenario](https://github.com/InteropIO/manager-examples/tree/main/manager-template/1-basic) via the [template repository](https://docs.interop.io/manager/deployment/index.md#template_repository) approach). The `manager` Docker image can be configured via environment variables.

The following example demonstrates providing settings for the `manager` Docker image:

```ini
# Health check mode for the `manager` Docker image.
DOCKER_HEALTHCHECK_MODE=http-connectivity
```

The following environment variables are available for configuring the `manager` Docker image:

| Environment Variable | Description |
|----------------------|-------------|
| `DOCKER_HEALTHCHECK_MODE` | Controls the behavior of the Docker health check. Set to `db-connectivity` (default) to use the `GET /db-connectivity` endpoint to perform a database connectivity health check. Set to `http-connectivity` to use the `GET /` endpoint to perform a basic health check. Set to `none` to disable the health check handler and instruct it to always report a healthy status. |
