Interface: WSClientConfigurableOptions
Extended by
Properties
| Property | Type | Description |
|---|---|---|
apiRegion? | APIRegion | Select 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? | boolean | Set 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? | string | Your 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? | number | How often to check if the connection is alive |
pongTimeout? | number | How long to wait for a pong (heartbeat reply) before assuming the connection is dead |
promiseSubscribeRequests? | boolean | Default: 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? | number | Delay in milliseconds before respawning the connection |
recvWindow? | number | Define a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds |
requestOptions? | AxiosRequestConfig<any, any> | - |
restOptions? | RestClientOptions | REST options reused for WebSocket routing. Regional and site ID values are retained as fallbacks; prefer the matching top-level apiRegion and siteId options. |
secret? | string | Your API secret |
siteId? | string | Site 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? | boolean | Set 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 | - |