TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/gateio-api/llms.txt
Use this file to discover all available pages before exploring further.
gateio-api SDK is primarily designed for Node.js server-side environments, but it can also be bundled for use in browser-based applications using the included webpack configuration. The package ships with isomorphic-ws for WebSocket compatibility across environments, making it possible to use both REST and WebSocket functionality in the browser with some important caveats.
Supported Environments
| Environment | Support level |
|---|---|
| Node.js (v16+) | ✅ Full support — recommended for all trading applications |
| Browser (via webpack bundle) | ⚠️ Partial support — public endpoints only; some Node.js-only features are excluded |
| Edge/Serverless (Cloudflare Workers, etc.) | ⚠️ May work for REST; not officially tested |
http and https core modules (which power the keepAlive connection pool feature) because those are not available in the browser. All other features compile cleanly.
keepAlive and keepAliveMsecs options in RestClientOptions are silently ignored in browser builds — connection pooling is handled automatically by the browser itself.
Building the Webpack Bundle
Install dependencies
Clone or download the
gateio-api repository and install all dependencies, including the webpack dev dependencies:Compile TypeScript
Run the TypeScript compiler to generate the compiled JavaScript output in The webpack bundler uses the CommonJS output (
dist/. This step produces both ESM (dist/mjs/) and CommonJS (dist/cjs/) builds:dist/cjs/index.js) as its entry point.Bundle Output
After runningnpm run pack, the following files are written to the dist/ directory:
| File | Description |
|---|---|
dist/gateapi.js | Minified UMD bundle — include this in your HTML or frontend build |
dist/gateapi.map | Source map for debugging |
doc/bundleReport.html | Bundle analyser report generated by webpack-bundle-analyzer |
gateapi, making it accessible as window.gateapi when loaded via a <script> tag or importable by any module system that supports UMD.
Using the Bundle in HTML
Proxy and Custom Base URL Configuration
If your browser application routes requests through a backend proxy (recommended for authenticated calls), you can override the SDK’s base URL:networkOptions parameter, which is forwarded directly to axios:
Axios proxy configuration uses Node.js
http/https agents and may not work in all browser environments. For browser-based proxying, a service worker or a custom baseUrl pointing to your own backend is more reliable.Available baseUrlKey Options
Instead of specifying a full URL, you can select one of the SDK’s built-in base URL aliases:
WebSocket Support in the Browser
The SDK usesisomorphic-ws, which automatically selects the native browser WebSocket API when running in a browser context. No additional configuration is required: