Skip to content

Node.js installation

Install @xbbg/core.

npm and Bun install the package together with the prebuilt native addon for your platform. The addon then loads Bloomberg's SDK runtime library from the same machine.

Requirements ​

RequirementDetails
RuntimeNode.js 24 or newer (engines.node is >=24) or Bun 1.4 or newer. Server runtimes only; there is no browser build.
PlatformPrebuilt addons for macOS arm64, Linux x64 (glibc 2.28 or newer), and Windows x64.
BloombergAccess through the Desktop API (a Terminal session), B-PIPE, SAPI, or ZFP, plus the Bloomberg C++ SDK runtime library on the same machine.

Install ​

bash
npm install @xbbg/core
bash
bun add @xbbg/core

Package page: npm / @xbbg/core

What gets installed ​

PackageRole
@xbbg/coreThe JavaScript entry point with TypeScript declarations. It is a CommonJS package that also works with import, including named imports, from ES modules and TypeScript.
apache-arrow ^21.1.0Runtime dependency for result tables. Add it to your own package.json if you import its types.
@xbbg/core-darwin-arm64, @xbbg/core-linux-x64, @xbbg/core-win32-x64Optional dependencies, one per platform, each holding the native addon. npm and Bun install only the one that matches your machine.
nodejs-polars >=0.10.0Optional peer dependency. Install it yourself only if you use backend: 'polars'.
bash
# Only needed for backend: 'polars'
npm install nodejs-polars

Bloomberg SDK runtime ​

Importing @xbbg/core loads the native addon immediately, and the addon needs Bloomberg's SDK runtime library: blpapi3_64.dll on Windows, libblpapi3_64.so on Linux, or libblpapi3.dylib on macOS. If the library cannot be found, the import itself throws; no request is needed to see the failure.

  • Windows. Before loading the addon, @xbbg/core puts the first directory that contains the runtime at the front of PATH. BLPAPI_LIB_DIR (the directory holding the library) is checked first, then BLPAPI_ROOT (an SDK root; its bin and lib folders are also checked), then the standard Bloomberg Terminal DAPI install directories. A Terminal installed in the default location needs no configuration.
  • Linux and macOS. The system dynamic loader must be able to resolve the library, for example through the standard library search path or LD_LIBRARY_PATH on Linux.

Verify the installation ​

bash
node -e "console.log(require('@xbbg/core').version())"

This prints 1.8.0. It loads the native addon and the Bloomberg SDK runtime but opens no Bloomberg session; sessions start only when an engine is created.

ts
import * as xbbg from '@xbbg/core';

console.log(xbbg.version()); // '1.8.0'
console.log(Object.keys(xbbg.blp)); // ['abdh', 'abdib', 'abdp', ...]

Connect ​

With no configuration, @xbbg/core connects to a Desktop API session on localhost:8194. Pass an EngineConfig to connect() or configure() for B-PIPE hosts, failover, authorization, TLS, ZFP, or SOCKS5:

ts
import { connect } from '@xbbg/core';

const engine = await connect({ host: 'localhost', port: 8194 });
console.log(engine.isAvailable()); // true when a request session is healthy

See the Quickstart for first requests and Configuration for every connection setting.

Other platforms ​

There are no prebuilt addons for other targets, such as Linux arm64 or macOS x64. On those platforms the import fails with a message saying that no packaged native addon is available. Building the addon from source needs a checkout of the xbbg repository, Rust 1.88 or newer, and an authorized Bloomberg C++ SDK; the repository documents the build.

Next steps ​

Quickstart

Make your first reference, historical, intraday, and BQL requests.

Configuration

Connect to B-PIPE, ZFP, or proxied endpoints and tune the engine.

Package Map

Choose between xbbg, @xbbg/core, and the agent adapters.

xbbg is independent open-source software and is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P.