Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions sdks/coinbase/docs/clients.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,48 @@
---
title: "Coinbase Advanced Trade SDK clients"
description: "Choose REST requests or streaming subscriptions for Advanced Trade."
title: "Coinbase SDK clients"
description: "Choose a Coinbase REST client, shared WebSocket subscriptions or the Global WebSocket API."
---

# Advanced Trade clients
# Coinbase clients

Use these two clients for Advanced Trade brokerage APIs. Looking for Global derivatives, Exchange, INTX, Prime, App or Commerce? [Choose your Coinbase API](/products).
Choose the client for your Coinbase product. The main walkthroughs use Advanced Trade spot; the other product guides keep their accounts, credentials and protocols separate.

<!-- #region client-list -->
| Client | Purpose |
| --- | --- |
| [`CBAdvancedTradeClient`](/api/classes/CBAdvancedTradeClient) | Advanced Trade REST: market data, accounts, orders and supported derivatives endpoints. |
| [`WebsocketClient`](/api/classes/WebsocketClient) | Advanced Trade market and user subscriptions, selected with `advTradeMarketData` or `advTradeUserData`. |
| [`CBAdvancedTradeClient`](/api/classes/CBAdvancedTradeClient) | Advanced Trade spot and US futures (CFM): market data, accounts and orders. [Advanced Trade guide](/getting-started). |
| [`CBAdvancedTradeGlobalClient`](/api/classes/CBAdvancedTradeGlobalClient) | Advanced Trade international derivatives on the Deribit-powered Starbase gateway. [Global derivatives guide](/products/global). |
| [`CBAppClient`](/api/classes/CBAppClient) | Coinbase App wallet accounts and transactions. [App guide](/products/app). |
| [`CBExchangeClient`](/api/classes/CBExchangeClient) | Coinbase Exchange REST market data, accounts and orders. [Exchange guide](/products/exchange). |
| [`CBInternationalClient`](/api/classes/CBInternationalClient) | International Exchange instruments, portfolios and orders. [INTX guide](/products/international). |
| [`CBPrimeClient`](/api/classes/CBPrimeClient) | Prime institutional trading, portfolios and custody. [Prime guide](/products/prime). |
| [`CBCommerceClient`](/api/classes/CBCommerceClient) | Commerce charges and checkouts. [Commerce guide](/products/commerce). |
| [`WebsocketClient`](/api/classes/WebsocketClient) | Shared public and private subscriptions across supported Coinbase platforms, selected with `WS_KEY_MAP`. [Stream selection](/clients#websocket-subscriptions). |
| [`WebsocketAPIClient`](/api/classes/WebsocketAPIClient) | Awaitable Global derivatives JSON-RPC requests over WebSocket. [Global WebSocket API](/products/global#ws-api). |
<!-- #endregion client-list -->

## REST requests
Advanced Trade international derivatives moved to Starbase on 1 October 2026. Use `CBAdvancedTradeGlobalClient` for those markets, even though `CBAdvancedTradeClient` still exposes older INTX methods. Spot and US futures remain on `CBAdvancedTradeClient`. See the [Coinbase migration guide](https://docs.cdp.coinbase.com/coinbase-app/advanced-trade-apis/guides/derivatives/technical).

## Advanced Trade REST requests

<<< @/../examples/first-call.ts

Methods return response bodies directly, not Axios response wrappers. Public market-data methods have `Public` in their name. Account and order methods require [Advanced Trade credentials](/guides/authentication).

## WebSocket subscriptions

Register listeners before calling `subscribe()`. Pass the correct Advanced Trade `WS_KEY_MAP` value and receive parsed data on `update`. See [WebSocket subscriptions](/guides/websockets) and [private account updates](/guides/private-streams).
Register listeners before calling `subscribe()`. `WebsocketClient` manages connections for the selected `WS_KEY_MAP` key and emits parsed data on `update`. Choose the key, channels and credentials for the product you use:

| Product | Subscription keys | Guide |
| --- | --- | --- |
| Advanced Trade | `advTradeMarketData`, `advTradeUserData` | [Public streams](/guides/websockets), [private account updates](/guides/private-streams) |
| Global derivatives | `advTradeGlobalMarketData`, `advTradeGlobalUserData` | [Public streams](/products/global#public-streams), [private account updates](/products/global#private-streams) |
| Exchange | `exchangeMarketData`, `exchangeDirectMarketData` | [Exchange streams](/products/exchange#public-streams) |
| International Exchange | `internationalMarketData` | [INTX streams](/products/international#public-streams) |
| Prime | `primeMarketData` | [Prime streams](/products/prime#public-streams) |

## Global WebSocket API

`WebsocketClient` also supports other Coinbase products, but their channels and credentials belong to their own product guides. `WebsocketAPIClient` is for [Global derivatives](/products/global), not Advanced Trade spot order entry.
`WebsocketAPIClient` provides awaitable request-response methods for Global derivatives, with the convenience of REST-style calls over a persistent WebSocket connection. It uses the dedicated `advTradeGlobalWSAPI` connection, separate from subscriptions. It is not an Advanced Trade spot order-entry client. See the [Global WebSocket API guide](/products/global#ws-api).

[Advanced Trade reference](/reference) · [Choose another API](/products)
[Advanced Trade reference](/reference) · [Choose a Coinbase API](/products)
4 changes: 4 additions & 0 deletions sdks/coinbase/docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ The [React](/environments/react) and [Vite](/environments/vite) projects use pub

REST access in a browser depends on Coinbase's CORS policy. If a request is blocked by CORS, call the SDK through a server route instead. A Vite development proxy is not a production server route.

### Webpack bundle

The [SDK README](https://github.com/sieblyio/coinbase-api#browserfrontend-usage) also describes building a standalone Webpack bundle from the SDK repository with `npm install`, `npm run build` and `npm run pack`. Its configuration produces the `coinbaseapi` UMD bundle in `dist/`. That is a separate packaging option, not a prerequisite for the Vite or React projects above, which import the npm package directly. The README does not yet document bundle usage in detail.

## React Native and Expo

The [Expo guide](/environments/expo) includes the Metro resolver, public-auth helper and required polyfills. Keep those files together. The project uses public market data; authenticated operations belong on your server.
Expand Down
2 changes: 1 addition & 1 deletion sdks/coinbase/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The [Node.js quickstart](/getting-started) reads a public Bitcoin price without

<!--@include: ./clients.md#client-list-->

Coinbase's API families have different accounts, credentials and protocols. These guides focus on **Advanced Trade** unless stated otherwise.
Coinbase's API families have different accounts, credentials and protocols. The main walkthroughs use **Advanced Trade spot**. For international derivatives, use the [Global client and guides](/products/global); US futures (CFM) remain on `CBAdvancedTradeClient`.

## Next steps

Expand Down
3 changes: 2 additions & 1 deletion shared/coinbase-sidebar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export function coinbaseSidebar(sdk, groups) {
reference.items = [
{ text: 'Advanced Trade reference', link: '/reference' },
{ text: 'CBAdvancedTradeClient', link: '/api/classes/CBAdvancedTradeClient' },
{ text: 'Advanced Trade WebSocket subscriptions', link: '/api/classes/WebsocketClient' },
{ text: 'Shared WebSocket client', link: '/api/classes/WebsocketClient' },
{ text: 'Global WebSocket API', link: '/products/global#ws-api' },
{ text: 'All SDK exports', link: '/api/' },
];
const products = {
Expand Down
Loading