Instant Bloomberg

Overview

The Instant Bloomberg Adapter can be configured via an io.Connect app definition or environment variables. The Instant Bloomberg credentials can be embedded in the app definition, injected as environment variables, or fetched at runtime from a remote location.

Configuration

The Instant Bloomberg Adapter is a Node.js service that must have a valid io.Connect app definition for a Node.js app in order to be included in the io.Connect environment.

Depending on your deployment approach, you can use the provided local and remote app definition templates located in the /io-apps/app-config directory, or you can modify the ibchat.json file.

The functionalities of the Instant Bloomberg Adapter can be configured both via the app definition or via environment variables. When both are used, the settings specified in the app definition take precedence.

App Definition

To configure the functionalities of the Instant Bloomberg Adapter, use the "ibChatAdapter" property of the "customProperties" top-level key in the app definition.

The "ibChatAdapter" object has the following properties:

Property Type Description
"cacheMinutesTTL" number Time-to-live for cached messages in minutes. Set to 0 to disable expiration. Defaults to 1440 (1 day).
"decryptPattern" string Pattern for deriving the decryption passphrase for the Instant Bloomberg credentials. If the value doesn't contain a $ symbol, it's treated as an environment variable name (e.g., "USERNAME"). If it contains $VARNAME_ tokens, each token is replaced with the corresponding env var value (e.g., "io.$GLUE-ENV_-$GLUE-REGION_"). If empty or not set, no decryption is performed (credentials are used as plaintext).
"enableAutoCache" boolean If true, the Instant Bloomberg Adapter auto-subscribes to all visible streams at startup and caches incoming messages. Defaults to false.
"fetchKeyConfig" object Configuration for fetching credentials from a remote source at runtime.
"healthCheckInterval" number Interval in milliseconds for IB Connect API health check polling. Defaults to 30000.
"ibChat" object Bloomberg IB Connect API connection settings, including the host URL and encrypted credentials.
"keepRotatedCache" boolean If true, rotated cache files are archived with a date suffix ({streamId}_{YYYY-MM-DD}.json) instead of being deleted. Recommended for development environments. Defaults to false.
"logLevel" string Logging level. Accepted values: "trace", "debug", "info", "warn", "error". Defaults to "info".
"maxMessagesPerStream" number Maximum number of messages to cache per stream. Defaults to 100.
"maxTotalMessages" number Maximum total messages cached across all streams. Defaults to 1000.
"myBbgUuid" number The Bloomberg numeric UUID of the logged-in user. Used as a fallback for recipientUuid in IDEA payloads. If not set, the Instant Bloomberg Adapter calls T42.BBG.GetMe at runtime to resolve it.
"rotateCacheOnTTLExpiry" boolean If true, cache files are rotated when the oldest cached message exceeds "cacheMinutesTTL". Recommended for production environments. Defaults to false.
"storagePath" string Directory path for storing cached messages. Defaults to "./.cache/messages".

The "fetchKeyConfig" object has the following properties:

Property Type Description
"fetchOptions" object Additional headers (for "url") or arguments (for "method") to include in the request.
"isJson" boolean Required. If true, parses the response as JSON (expects an AdapterConfig shape). If false, uses the raw text as clientSecret.
"keyPath" string Path to the key in the JSON response if "isJson" is true (e.g., "data.token").
"maxRetries" number Maximum number of retry attempts if fetching fails. Defaults to 10.
"target" string Required. The URL or interop method name to fetch credentials from.
"targetType" string Required. Source type: "url" (HTTP endpoint) or "method" (interop method).
"throttleMs" number Delay in milliseconds between retry attempts. Defaults to 2000.
"tokenAuthHeaderKey" string Header key for the authentication token in the request. Defaults to "Authorization".
"tokenObject" object Token object to include in the request.
"tokenPlaceholder" string Placeholder for the token value in the request.

The "ibChat" object has the following properties:

Property Type Description
"clientId" string Encrypted Bloomberg Client ID.
"clientSecret" string Encrypted Bloomberg Client Secret.
"host" string IB Connect API host URL. Defaults to "https://api.bloomberg.com".

Environment Variables

The following environment variables are available for configuring the Instant Bloomberg Adapter:

Environment Variable Description
DECRYPT_PATTERN Pattern for deriving the decryption passphrase at runtime. Supports plain env var names (e.g., USERNAME) or $VARNAME_ token templates (e.g., io.$GLUE-ENV_-$GLUE-REGION_). If empty or not set, no decryption is performed (credentials are used as plaintext).
IB_ADAPTER_APP_NAME App name used when connecting to io.Connect. Defaults to "IB_Chat_Adapter".
IB_ADAPTER_LOG_LEVEL Logging level. Accepted values: "trace", "debug", "info", "warn", "error". Defaults to "info".
IB_API_CLIENT_ID Encrypted Bloomberg Client ID.
IB_API_CLIENT_SECRET Encrypted Bloomberg Client Secret.
IB_API_HOST_URL IB Connect API host URL.
IB_ENABLE_AUTO_CACHE If "true", the Instant Bloomberg Adapter auto-subscribes to all visible streams at startup and caches incoming messages. Defaults to "false".
IB_HEALTH_CHECK_INTERVAL Interval in milliseconds for IB Connect API health check polling. Defaults to "30000".
IO_CD_PASSWORD Password for io.Connect authentication when running outside io.Connect Desktop. Defaults to "any_pass_works".
IO_CD_USERNAME Username for io.Connect authentication when running outside io.Connect Desktop. Falls back to the system USERNAME variable.
IO_CD_WS_URL io.Connect gateway WebSocket URL. Falls back to the GLUE-GATEWAY variable set by io.Connect Desktop.

Credentials

The Bloomberg IB Connect API requires a clientId (32 characters) and a clientSecret (64 characters) obtained from Bloomberg. Before being provided to the Instant Bloomberg Adapter, these must be encrypted using the encryption tool included in the bundle and located in the /configurator folder.

Decryption Pattern

The encryption tool provided with the Instant Bloomberg Adapter requires a decryption pattern that determines how the encryption and decryption passphrase is derived. The passphrase itself is never stored — only the pattern is stored. At runtime, the Instant Bloomberg Adapter resolves the pattern by using environment variables to decrypt the credentials.

⚠️ Note that, currently, the encryption tool supports only environment variables that don't contain underscores in their names. This will be addressed in a future release and may lead to changing the current $<var-name>_ format.

⚠️ Note that before running the encryption tool, all environment variables referenced by the selected decryption pattern must be set to non-empty values. The encryption tool will exit with an error if any referenced variables are missing or empty.

The decryption pattern supports two modes:

  • Plain environment variable names (no $ symbols in the specified pattern) — the entire string is treated as an environment variable name and its value is used as the passphrase (e.g., if you specify the "USERNAME" environment variable registered by Windows, the decrypted passphrase will resolve to the value of process.env.USERNAME).

  • Token template (the pattern contains tokens that use the $<variable-name>_ format) — each token is replaced with the corresponding environment variable value. Literal characters between tokens are preserved (e.g., "io.$IO_CD_ENV_-$IO_REGION_" resolves to "io.DEMO-INTEROP.IO").

The following table contains example patterns and the passphrase to which they resolve based on the specified environment variables:

Pattern Environment Variables Resolved Passphrase
USERNAME (already set by Windows) The value of the USERNAME environment variable.
MY-SECRET-KEY MY-SECRET-KEY The value of the MY-SECRET-KEY environment variable.
io.$GLUE-ENV_-$GLUE-REGION_ GLUE-ENV, GLUE-REGION (set by the platform) E.g., io.DEMO-INTEROP.IO

To encrypt the credentials, run the encryption tool located in the /configurator directory:

# Set each environment variable referenced by the selected decryption pattern to a non-empty value.
set MY-VAR=MY-VALUE
set MY-OTHER-VAR=MY-OTHER-VALUE

# Replace the arguments with the appropriate values.
setup-encryptions.exe <client-id> <client-secret> <decryption-pattern>

After running the tool, the encrypted credentials can be provided to the Instant Bloomberg Adapter via one of the following options.

App Definition

The recommended approach is to embed the encrypted credentials directly in the app definition by using the "ibChat" property of the "ibChatAdapter" object under the "customProperties" top-level key. The "decryptPattern" property must also be set in order for the Instant Bloomberg Adapter to be able to derive the passphrase at runtime:

{
    "customProperties": {
        "ibChatAdapter": {
            "decryptPattern": "io.$GLUE-ENV_-$GLUE-REGION_",
            "ibChat": {
                "host": "https://api.bloomberg.com",
                "clientId": "<encrypted-client-id>",
                "clientSecret": "<encrypted-client-secret>"
            }
        }
    }
}

Environment Variables

You can also use environment variables defined directly in the system.json file of io.Connect Desktop to provide the encrypted credentials. The DECRYPT_PATTERN variable must also be set in order for the Instant Bloomberg Adapter to be able to derive the passphrase at runtime:

{
    "envVars": {
        "set": {
            "DECRYPT_PATTERN": "io.$GLUE-ENV_-$GLUE-REGION_",
            "IB_API_HOST_URL": "https://api.bloomberg.com",
            "IB_API_CLIENT_ID": "<encrypted-client-id>",
            "IB_API_CLIENT_SECRET": "<encrypted-client-secret>"
        }
    }
}

9.0 Version Stream

If you are still using the io.Connect Desktop 9.0 version stream, environment variables must be provided via the gilding.json file of io.Connect Desktop:

{
    "envVars": {
        "set": {
            "DECRYPT_PATTERN": "io.$GLUE-ENV_-$GLUE-REGION_",
            "IB_API_HOST_URL": "https://api.bloomberg.com",
            "IB_API_CLIENT_ID": "<encrypted-client-id>",
            "IB_API_CLIENT_SECRET": "<encrypted-client-secret>"
        }
    }
}

Remote Source

Credentials can be loaded at runtime from a remote location. You can host the ibChatCredentials.json file (generated by the encryption tool) on an accessible server and configure the "fetchKeyConfig" property in the app definition to point to it. The "decryptPattern" property must also be set in order for the Instant Bloomberg Adapter to be able to derive the passphrase at runtime:

{
    "customProperties": {
        "ibChatAdapter": {
            "decryptPattern": "io.$GLUE-ENV_-$GLUE-REGION_",
            "fetchKeyConfig": {
                "targetType": "url",
                "target": "https://your-server.com/ibChatCredentials.json",
                "isJson": true
            }
        }
    }
}

This approach avoids embedding credentials in app definition files and enables centralized credential management.

Cache

The Instant Bloomberg Adapter caches received messages for retrieval via the "IO.BBG.IB_Chat.GetLastMessages" Interop method. Cache files are stored in JSON format in a configurable directory (defaults to .cache/messages/).

Messages are automatically persisted to disk and loaded on startup. Expired messages are removed at startup and during write operations when rotation is enabled. The oldest messages are removed when per-stream or total message limits are reached.

Logging

The Instant Bloomberg Adapter uses the io.Connect Logger API. You can set the logging level via the "logLevel" property in the app definition or via the IB_ADAPTER_LOG_LEVEL environment variable.

The following logging levels are available:

Level Description
debug Debug information. Logs almost everything.
error Errors only.
info General information. Default level.
trace Most verbose. No trace messages are logged by the Instant Bloomberg Adapter.
warn Warnings only.