TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sieblyio/kraken-api/llms.txt
Use this file to discover all available pages before exploring further.
@siebly/kraken-api SDK is not limited to Node.js. It is designed to work in modern browser environments as well, making it suitable for frontend dashboards, price widgets, and other client-side applications that need to consume Kraken market data. The key design decision that makes this possible is the SDK’s use of the browser-native Web Crypto API for HMAC signing rather than Node’s crypto module, which means no native bindings or Node-specific polyfills are needed for the signing path.
How it works
Two platform-specific concerns are handled deliberately in the SDK to support browsers: HMAC signing via Web Crypto API. All request signing useswebCryptoAPI primitives (SubtleCrypto.sign, SubtleCrypto.digest) that are available natively in every modern browser. There is no dependency on Node’s crypto module in the signing path. When you instantiate a client with API credentials in a browser, the SDK will call checkWebCryptoAPISupported() to confirm the environment provides the necessary crypto surface before attempting to sign requests.
WebSockets via isomorphic-ws. The WebsocketClient uses isomorphic-ws, which resolves to the browser’s built-in WebSocket constructor in browser environments and to the ws npm package in Node.js. No special configuration is needed — the SDK adapts automatically.
Node.js-only modules excluded via webpack fallbacks. The REST client optionally uses https.Agent for connection keep-alive — a Node.js-only feature. The webpack configuration explicitly excludes the http and https built-in modules so the browser bundle does not pull in Node internals. Browser connection pooling is handled automatically by the browser itself.
Building a browser bundle with webpack
The repository ships awebpack.config.cjs that produces a UMD bundle suitable for script-tag inclusion or module bundler consumption. Here is the full config as found in the source:
./dist/cjs/index.js, which means TypeScript must be compiled to CJS before webpack runs. The output is a single krakenapi.js file (plus a source map) written to the dist/ directory, exposed as a UMD library under the global name krakenapi.
Build steps
Install dependencies
Clone the repository (or work within your own project that depends on
@siebly/kraken-api) and install all dependencies:Compile TypeScript
Build the TypeScript source to the CJS output that webpack uses as its entry point:This populates
dist/cjs/ with the compiled JavaScript modules.Using the bundle
Once built, include the bundle in your HTML page via a<script> tag. The library is exposed as krakenapi on the global window object:
@siebly/kraken-api directly and let your bundler resolve the package — the same http/https fallback configuration applies.
Important limitations
Before deploying a browser-based Kraken integration, consider these constraints carefully. API keys are exposed in client-side code. Any credentials embedded in a browser bundle or passed to a client-sideSpotClient are readable by anyone who opens the browser’s developer tools. This includes your API key, API secret, and any network traffic. For this reason, private API calls should only be made from browser code in scenarios where the user is providing their own credentials (e.g. a personal dashboard running locally), not in a publicly deployed web application.
CORS restrictions. Kraken’s REST API does not set permissive CORS headers for browser origins. Direct browser-to-Kraken REST calls may be blocked by the browser’s CORS policy. Public WebSocket connections typically work without issue. If you need to make REST calls from a browser in a deployed application, route them through a backend proxy you control.
Recommended architecture for user-facing apps. Rather than calling Kraken directly from the browser, proxy sensitive REST calls through your own backend service. The backend holds credentials securely, signs requests server-side, and exposes only the data your frontend needs.