By default,Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/bitget-api/llms.txt
Use this file to discover all available pages before exploring further.
bitget-api logs connection lifecycle events, subscription confirmations, and errors to the console. The trace level is silenced in the default configuration to keep output manageable during normal operation, but all three log levels — trace, info, and error — can be overridden or replaced entirely. Every client constructor accepts a custom logger as its second argument, giving you full control over where and how log output is written.
The DefaultLogger
The SDK exports aDefaultLogger object that serves as the base implementation. You can import it, spread it into a new object, and selectively override only the methods you care about:
trace method is intentionally a no-op in the default export — it is designed to be enabled only while troubleshooting, because it emits high-frequency messages such as raw ping/pong frames and every incoming WebSocket message.
Suppress Trace Logs
If you have already enabled trace logging and want to turn it off, or if you want to be explicit about silencing it, overridetrace with an empty function:
Enable Trace Logs
To turn trace logs on — useful when debugging connection issues or understanding SDK internals — overridetrace with a real logging call:
Custom Logger
For production applications, replace the logger entirely with an object that satisfies the{ trace, info, error } interface. This lets you forward SDK logs into your own logging infrastructure (Winston, Pino, Datadog, etc.):
RestClientV3/RestClientV2 and WebsocketClientV3/WebsocketClientV2 follow the same convention.
Debug HTTP Requests
In rare situations you may need to inspect the raw HTTP requests being constructed — including headers, query strings, and request bodies — as well as the raw API responses. Enable this by setting theBITGETTRACE environment variable to true before starting your process:
.env file: