Bitget JavaScript SDK
Build with the Bitget REST API & WebSockets with our JavaScript SDK, TypeScript-first package declarations, and Node.js-compatible runtime patterns. Discover installation, common examples, a detailed endpoint-to-function map, and the REST API/WebSocket patterns shared across our Siebly SDK family.
Use the same TypeScript-first REST API and WebSocket clients from plain JavaScript or TypeScript in Node.js-compatible runtimes.
Package surfaces
Explore the following API capabilities are covered by our Bitget SDK:
- Spot
- Copy
- Futures
- WebSockets
- WebSocket clients with:
- Built-in heartbeats.
- Automatic reconnection.
- Automatic reauthentication and resubscribe where the exchange supports it.
- Typed requests and responses for Node.js, JavaScript, and TypeScript IDEs.
- Framework-neutral JavaScript snippets that stay approachable in Node.js-compatible runtimes.
- TypeScript-first package declarations for stricter services, shared libraries, and editor-assisted integrations.
Install Bitget SDK
# Via your favourite package manager, e.g. npm:
npm install bitget-api
# or pnpm:
pnpm install bitget-api
# or yarn:
yarn add bitget-apiQuickstart Examples with the Bitget JavaScript SDK
Get started with just a few lines of JavaScript. TypeScript, while not required, is absolutely recommended. TypeScript declarations are included with all our SDKs and provide convenient definitions on request & response fields, WebSocket payloads, and generally safer integrations.
Quickstart snippets are currently unavailable for this SDK and language combination.
Bitget API JavaScript Tutorial
A practical JavaScript guide to using bitget-api across Bitget V3/UTA REST, public and private streams, demo trading, WebSocket API commands, and V2/Classic fallback flows.
Your app / service
bot, dashboard, worker
bitget-api
RestClientV3, WebsocketClientV3, WebsocketAPIClient
Bitget APIs
V3/UTA REST, streams, WebSocket API, Classic fallbacks
Common Bitget implementation tasks
Start from the behavior you need, not just from REST or WebSocket as a transport. Market-data driven systems should be event driven. Backfill via the REST API once and let WebSockets passively stream new data to you, as it becomes available.
Bitget API tutorial
Use the focused tutorial for RestClientV3, UTA product values, private streams, demo trading, WebSocket API commands, and V2/Classic boundaries.
Open Bitget tutorialV3 private stream example
Use the private stream example for account, position, fill, and order topic subscriptions with instType set to UTA.
Open private stream exampleWebSocket API order example
Use the WebSocket API client example for promise-wrapped Bitget order placement, batch placement, cancellation, and batch cancellation.
Open WebSocket API exampleBackfill endpoint lookup
Use the endpoint reference to verify current V3 and Classic REST API method names, request shapes, response fields, and product-specific naming before coding.
Open endpoint referenceReconnect-safe consumer
Tell the agent to treat transport reconnect as separate from application correctness, then resync through REST before re-enabling event-driven workflows.
Open agent guidanceFor coding agents
Give these files to an agent before implementation so it can find the package, examples, task guidance, and safety rules from the normal SDK-page flow.
AI prompt framework
Prompt generator and task recipes for exchange API projects.
llms.txt
Compact discovery file for agents choosing where to start.
llms-full.txt
Full route and implementation guidance index for machine readers.
SDK catalog
Machine-readable package, docs, examples, and task guidance.
Agent skill
Reusable workflow rules for coding agents using exchange APIs.
Endpoint Function Reference
Bitget JavaScript FAQ
What does the Bitget JavaScript SDK cover?
Bitget supports Spot, Copy, Futures, and WebSockets workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.
How do I authenticate private Bitget API calls in JavaScript?
Install bitget-api from npm & pass API credentials into the SDK client options, as shown in the Bitget JavaScript examples above. The SDK handles the exchange-specific signing requirements for private requests.
Does the Bitget JavaScript SDK help with WebSocket connection management?
Yes. Use the SDK WebSocket client for subscriptions, reconnect handling, and stream lifecycle management instead of building raw socket flows yourself.
Where should I start on the Bitget JavaScript page: REST or WebSocket?
Start with the REST quick start for installation, authentication, and request and response flows. Move to the WebSocket example when you need streaming market or account updates.
Direct Example Files
Open the example files below for JavaScript and TypeScript-compatible request, authentication, WebSocket, and Node.js service patterns.