Skip to content

Runtime setup ​

Choose a project for your application. Each guide starts from an empty directory and includes the files, installation commands and a public Advanced Trade price example.

Server-side JavaScript and TypeScript ​

  • Node.js / JavaScript: ES modules and CommonJS.
  • Node.js / TypeScript: a typed project with build and run commands.
  • Next.js: a Node.js Route Handler that keeps SDK calls on the server.
  • Bun: npm dependencies and Bun scripts.
  • Deno: npm dependencies and explicit runtime permissions.

Keep account credentials and authenticated requests on your server. The authentication guide explains CDP keys and account reads.

Browser applications ​

The React and Vite projects use public market data. Their configuration supplies EventEmitter and excludes the SDK's Node-only JWT signer. Keep that configuration with the examples. Never put private keys in a browser bundle.

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 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 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.

Streaming lifecycle ​

Command-line streaming examples run until Ctrl+C. Browser and mobile examples expose a Stop control and clean up when their view is removed. Let the SDK reconnect after a connection loss; a reopened connection does not by itself restore application account state.

WebSocket subscriptions · Private account updates · Production usage

Built by Siebly. Open source SDKs for exchange APIs.