Skip to content

Interface: WSClientConfigurableOptions ​

Extended by ​

Properties ​

PropertyTypeDescription
apiRegion?APIRegionSelect WebSocket routing with the same region values as REST. Uses a dedicated mainnet stream when Bybit documents one for that region. Top-level apiRegion takes precedence over restOptions.apiRegion.
customSignMessageFn?(message: string, secret: string) => Promise<string>Allows you to provide a custom "signMessage" function, e.g. to use node's much faster createHmac method Look in the examples folder for a demonstration on using node's createHmac instead.
demoTrading?booleanSet to true to connect to Bybit's V5 demo trading: https://bybit-exchange.github.io/docs/v5/demo Only the "V5" "market" is supported here.
key?stringYour API key
market?"v5"The API group this client should connect to. The V5 market is currently used by default. Only the "V5" "market" is supported here.
pingInterval?numberHow often to check if the connection is alive
pongTimeout?numberHow long to wait for a pong (heartbeat reply) before assuming the connection is dead
promiseSubscribeRequests?booleanDefault: false. When enabled, any calls to the subscribe method will return a promise. Note: internally, subscription requests are sent in batches. This may not behave as expected when subscribing to a large number of topics, especially if you are not yet connected when subscribing.
reconnectTimeout?numberDelay in milliseconds before respawning the connection
recvWindow?numberDefine a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds
requestOptions?AxiosRequestConfig<any, any>-
restOptions?RestClientOptionsREST options reused for WebSocket routing. Regional and site ID values are retained as fallbacks; prefer the matching top-level apiRegion and siteId options.
secret?stringYour API secret
siteId?stringSite ID sent as x-site-id during the Node.js WebSocket handshake. Brazil and Argentina internal accounts now use stream.bybit.com without this header. Keep passing it only if a remaining site still requires x-site-id.
testnet?booleanSet to true to connect to Bybit's testnet environment. Notes: - If demo trading, testnet should be set to false! - If testing a strategy, use demo trading instead. Testnet market data is very different from real market conditions.
wsOptions?{ protocols?: string[] | undefined; agent?: any; } & (Omit<Partial<ClientOptions>, "agent"> | Omit<Partial<ClientRequestArgs>, "agent">)-
wsUrl?string-

Built by Siebly. Open source SDKs for exchange APIs.