TheDocumentation 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 SDK ships with two approaches for running in browser environments. Modern TypeScript projects can use direct ESM imports with crypto polyfills configured via tsconfig.json path aliases, while projects that need a classic <script> tag can use the included webpack configuration to build a self-contained UMD bundle. Both approaches give full access to the REST and WebSocket APIs from the browser.
Approach 1: Modern ESM Imports
This is the recommended approach for TypeScript projects and modern bundlers (Vite, esbuild, Angular, etc.). You map Node.js built-in modules to their browser-compatible polyfill equivalents using TypeScript’spaths compiler option.
Install browser polyfills
Install the browser-compatible versions of Node.js built-in modules that
bitget-api depends on:Configure tsconfig.json paths
Add
paths entries to your tsconfig.json to redirect crypto and stream imports to their browser polyfills:Approach 2: Webpack Bundle
This is the classic approach for serving the SDK as a minified JavaScript file loaded via a<script> tag on any webpage. The repository ships a ready-made webpack.config.cjs that produces a UMD bundle.
The webpack configuration targets UMD output and excludes the Node.js-only
http and https modules via resolve.fallback, so the bundle works in browsers without those native modules:
The webpack bundle and the ESM import approach should have largely consistent API surface, but small differences may exist. In particular, Node.js-only features such as the
https.Agent keep-alive option (keepAlive: true) are silently skipped in browser environments because the https module is excluded from the bundle.