Troubleshooting
Wrong package or missing clients
Install @siebly/kraken-api. The unscoped kraken-api package is a different library. Import public clients from the package root, not internal file paths.
Browser REST and CORS
In @siebly/kraken-api@1.1.10, a default SpotClient adds UserAgent and locale request headers. Chrome sends an OPTIONS preflight before the public ticker GET. Kraken returns 404 without the required CORS response headers, so Axios reports ERR_NETWORK even though public WebSocket updates work. An events alias fixes bundling, not this network failure.
The Vite and React public-price examples use the SDK's second constructor argument, AxiosRequestConfig, with transformRequest to remove just those headers before the public GET. Passing headers alone does not work in this version because the SDK overwrites that option. The transform is deliberately limited to GET requests and replaces Axios's usual request-body transform. Do not reuse it for POST requests or authenticated calls.
Browser REST requests require Kraken to allow your application's origin. Never disable browser security or use no-cors, which prevents reading the response.
To fetch prices on the server, use the Next.js API route. It creates a SpotClient on the Node.js server and exposes the public price at /api/price. A browser application can request that same-origin route instead of calling Kraken REST directly. In production, expose only the operations your app needs, with suitable validation, rate limits and authentication. Keep API credentials on the server. Do not create an unrestricted forwarding proxy.
Testnet is unavailable
Spot has no public testnet. Kraken retired its public Futures demo, and testnet: true throws in this SDK. Use public reads or Spot order validation for non-trading development; do not treat a beta API endpoint as simulated trading.
Invalid symbol or unexpected response key
Spot REST aliases and WebSocket v2 symbols differ. The examples use XBTUSD for REST and BTC/USD for WebSocket v2. REST may return a canonical pair key such as XXBTZUSD. Use returned keys or instrument metadata instead of assuming the input alias is the result key. Futures uses contract symbols from its own market-data API.
Authentication or nonce errors
Use credentials for the correct product, check permissions and IP restrictions, and provide the original base64 Spot API secret. Coordinate processes sharing a key to prevent out-of-order private request nonces. See Authentication.
No private stream updates
Check the key's WebSocket access and channel permissions. Register listeners for response and exception before subscribing. A subscription request is not confirmation of acceptance. The SDK manages the Spot token automatically. See the private account updates example.
No ticker messages
Check subscription replies and use the correct connection key and symbol format shown in the ticker subscription example. Ticker updates depend on market activity and channel options. Log unmatched messages while diagnosing the connection.
An order request timed out
Check matching private execution events before assuming it failed. If the outcome remains unclear, use REST to recover the missing order and execution state before another submission; see Production usage.
TypeScript checks
The SDK works with both JavaScript and TypeScript. TypeScript is optional, but we strongly recommend it for SDK integrations: the included types help catch invalid method names, parameter shapes and response assumptions at build time, before requests reach the exchange. If you choose TypeScript, follow the TypeScript setup and run npx tsc --noEmit during development and CI. Type checking does not replace runtime validation or exchange-side checks.
Some runtimes can execute TypeScript directly. For example, Node.js type stripping supports erasable TypeScript syntax without a separate compiler, but does not check types. If your runtime cannot execute the syntax used by a TypeScript example, compile that example to JavaScript or use a compatible TypeScript runner. Examples with local .js imports that refer to TypeScript source files can use the compiler-based setup above. Plain JavaScript usage does not need any TypeScript tooling.