SDK guide
JavaScript
REST API + WebSocket

Kraken JavaScript SDK

Build with the Kraken 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 Kraken SDK:

  • Spot
  • Futures
  • WebSockets
  • WebSocket API
  • WebSocket clients with:
    • Built-in heartbeats.
    • Automatic reconnection.
    • Automatic reauthentication and resubscribe where the exchange supports it.
  • Promise-wrapped WebSocket API commands you can await like a REST API.
  • 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 Kraken SDK

# Via your favourite package manager, e.g. npm:
npm install @siebly/kraken-api
# or pnpm:
pnpm install @siebly/kraken-api
# or yarn:
yarn add @siebly/kraken-api

Quickstart Examples with the Kraken 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.

Showing cached quickstart content from build-time configuration.
Full Kraken course

Kraken API JavaScript Tutorial

A richer JavaScript guide for building Kraken Spot REST, Futures REST, public and private WebSockets, WebSocket API trading, reconnect handling, and production rollout patterns with @siebly/kraken-api.

Spot and Futures clients
Public and private streams
Promise-wrapped WebSocket API trading
Production reconnect and backfill workflows
REST API
WebSocket Streams
WebSocket API
Examples

Your app / service

bot, dashboard, worker

@siebly/kraken-api

SpotClient, DerivativesClient, WebsocketClient

Kraken APIs

Spot REST, Futures REST, WebSockets, WebSocket API

Endpoint Function Reference

Kraken JavaScript FAQ

What does the Kraken JavaScript SDK cover?

Kraken supports Spot, Futures, WebSockets, and WebSocket API workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.

How do I authenticate private Kraken API calls in JavaScript?

Install @siebly/kraken-api from npm & pass API credentials into the SDK client options, as shown in the Kraken JavaScript examples above. The SDK handles the exchange-specific signing requirements for private requests.

Does the Kraken 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.

When should I use the Kraken WebSocket API instead of REST?

Use REST for standard request and response workflows such as account queries and order management. Use the WebSocket API flow when you want persistent low-latency interactions over a connected session.

Direct Example Files

Continue with implementation resources