Troubleshooting
Imports and module formats
Install @siebly/htx-api in the application directory. Use .mjs for ES modules or .cjs for CommonJS. Follow a complete runtime setup rather than copying a component without its configuration files.
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.
Authentication failures
Confirm the API key's permissions, account access and IP restrictions. Check the host clock and selected product. Do not substitute a user ID for the Spot account ID returned by getAccounts(). Inspect sanitized exchange codes without printing request headers or signatures.
No WebSocket data
Use message, not update, for channel data. Match the topic and connection key, and inspect response and exception events. subscribe() returns void; it does not confirm server acceptance. Keep the process alive and close the client only when the stream is no longer needed.
Public market channels carry compressed data and require DecompressionStream. Check that API in the actual runtime, especially in React Native. Bundling does not install a decompressor. If the target lacks it, provide an appropriate runtime implementation or relay market data from a backend.
Browser REST and CORS
The SDK provides browser transport mappings, but direct REST requests still depend on HTX's CORS policy and regional access. Keep the supplied Vite configuration. If public reads are blocked, use a server route with suitable access controls. Do not move private credentials into a browser to solve an authentication error.
Order timeouts and rejected orders
Check current instrument precision and limits, account mode, order type and the meaning of amount. Treat an unknown submission result as uncertain, not automatically rejected. Recover the order before retrying. A batch can partially succeed.
Testing and connectivity
AWS and alternative domains remain production services. See Testing without orders. A timeout alone does not identify the SDK as the cause; verify network, exchange availability and account or regional restrictions separately.