Skip to content

Configuration ​

For HTTP, HTTPS or SOCKS routing in Node.js, see Use a proxy.

Configure a REST client ​

ts
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({}, { timeout: 10000 });

export { client };

The first argument contains SDK options such as apiKey and apiSecret. The second contains Axios request options. Here, timeout: 10000 sets a ten-second HTTP timeout.

Reuse a client for each account and product rather than creating one for every request.

Environments ​

The clients use Kraken's live APIs by default. Spot has no public testnet. Kraken retired the public Futures demo environment; in this SDK, testnet: true throws instead of selecting a test environment.

Use public market-data reads or Spot order validation when developing without placing an order. Validation is not simulated trading and does not test fills or a complete order lifecycle.

Kraken's Futures testing-environment notice

Credentials and products ​

Use Spot credentials with SpotClient and private Spot streams; use Futures credentials with DerivativesClient and private Futures streams. The authentication guide shows secure configuration for Spot.

For streaming, pass a connection key from WS_KEY_MAP to subscribe(). For example, spotPublicV2 selects public Spot v2 data and spotPrivateV2 selects private Spot v2 data.

Production usage · Error handling

See Testing without orders for ways to validate your integration without placing orders.

Built by Siebly. Open source SDKs for exchange APIs.