Skip to main content

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 provided value doesn't contain % symbols, the entire value is treated as an environment variable name (e.g., "USERNAME"). If the pattern contains strings surrounded by % symbols, those strings are treated as environment variables and each is replaced with the corresponding value. If empty or not set, decryption isn't performed and 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 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" "trace" | "debug" | "info" | "warn" | "error" Logging level. 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 will resolve it at runtime if the Bloomberg Terminal is running.
"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 (when "targetType" is "url") or arguments (when "targetType" is "method") to include in the request.
"isJson" boolean Required. If true, parses the response as JSON. If false, uses the raw text as a client secret.
"maxRetries" number Maximum number of retry attempts if fetching fails. Defaults to 10.
"target" string Required. The URL from which to fetch credentials or the name of the Interop method to use for fetching credentials.
"targetType" "url" | "method" Required. Specifies the credentials source type (URL or an Interop method).
"throttleMs" number Interval in milliseconds between retry attempts. Defaults to 2000.

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 for the Instant Bloomberg credentials. If the provided value doesn't contain % symbols, the entire value is treated as an environment variable name (e.g., USERNAME). If the pattern contains strings surrounded by % symbols, those strings are treated as environment variables and each is replaced with the corresponding value. If empty or not set, decryption isn't performed and 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. Accepts trace, debug, info, warn, or 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. Defaults to https://api.bloomberg.com.
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. Defaults to the USERNAME environment variable set by Windows.
IO_CD_WS_URL WebSocket URL for connecting to the io.Connect Gateway. Defaults to the URL 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.

The decryption pattern can reference any environment variables registered by io.Connect Desktop, by the OS, or your own custom ones.

⚠️ 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.

  • 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.

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 USERNAME (set by Windows) The value of the USERNAME environment variable.
MY-SECRET-KEY MY-SECRET-KEY (set by the user) The value of the MY-SECRET-KEY environment variable.
io.%IO_CD_ENV%-%IO_CD_REGION% IO_CD_ENV, IO_CD_REGION (set by the platform) If the default platform values are used, this will resolve to io.DEMO-INTEROP.IO.

To encrypt the credentials, run the encryption tool located in the /configurator directory. The tool accepts the clientId, clientSecret, and the decryption pattern as arguments and outputs the encrypted credentials that can be provided to the Instant Bloomberg Adapter.

For the Windows command prompt, use double %% to escape the % symbol:

set MY_ENV_VAR=my-value
setup-encryptions.exe <client-id> <client-secret> my_pattern-%%MY_ENV_VAR%%

For PowerShell, use single quotes to prevent % expansion:

$env:MY_ENV_VAR = 'my-value'
.\setup-encryptions.exe <client-id> <client-secret> 'my_pattern-%MY_ENV_VAR%'

For Git Bash, no escaping is needed:

export MY_ENV_VAR=my-value
./setup-encryptions-linux <client-id> <client-secret> my_pattern-%MY_ENV_VAR%

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": "my_pattern-%MY_ENV_VAR%",
            "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": "my_pattern-%MY_ENV_VAR%",
            "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": "my_pattern-%MY_ENV_VAR%",
            "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": "my_pattern-%MY_ENV_VAR%",
            "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.