Configuration
Configure a REST client
import { RestClientV5 } from 'bybit-api';
export const client = new RestClientV5(
{ testnet: true, recv_window: 5000, parseAPIRateLimits: true },
{ timeout: 10000 },
);The first constructor argument contains SDK settings such as testnet, key, secret and recv_window. The second contains Axios request options, including timeout in milliseconds.
The example selects Testnet and a ten-second HTTP timeout. recv_window controls the signed request acceptance window; it is not the HTTP timeout.
Select an environment
The default is live. Set testnet: true for Testnet or demoTrading for demo trading, with credentials for that environment. Bybit's demo documentation lists supported endpoints.
Rate-limit information
parseAPIRateLimits: true adds rateLimitApi from the response headers when available. Use it alongside Bybit's endpoint limits to schedule requests.
Reuse clients
Reuse a client for each credential and environment combination. Limit concurrent requests in the application.