Official Node.js client library for the Bitfinex cryptocurrency exchange API. Version 8.0.0 supports REST v2 and WebSocket v2/v1 APIs, providing real-time trading, order management, and market data. Requires Node >=18.0. Key differentiators: official library with full coverage of Bitfinex endpoints, built-in WebSocket management, automatic reconnection, and order tracking via event emitters. Actively maintained with regular releases. Alternative to community libraries like ccxt, but Bitfinex-specific and supports advanced features like margin trading and funding.
npm install bitfinex-api-nodeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to Bitfinex WebSocket, authenticates, subscribes to BTCUSD trades, and logs incoming trades.
Pass credentials inside an options object: new BFX({ apiKey: '...', apiSecret: '...' })Use WebSocket v2 API (WSv2) instead of the v1 WebSocket client.
Iterate over sub-arrays: orders.forEach(order => ...) where order is an array.
Upgrade Node.js to version 18 or later, or pin to an older version of the library.
Use `import BFX from 'bitfinex-api-node'` (default) not `import { BFX } from 'bitfinex-api-node'`Ensure only one WebSocket instance is created, or close previous connections before opening new ones.
Pass apiKey and apiSecret as strings inside the options object: new BFX({ apiKey: '...', apiSecret: '...' })Ensure you call ws.open() and wait for the 'open' event before sending messages.