Installation

Install the SDK via your package manager or a <script> tag.

Package Manager

npm i @nktkas/hyperliquid

CDN

If you're not using a package manager, you can use the SDK via an ESM-compatible CDN such as esm.sharrow-up-right. Simply add a <script type="module"> tag to the bottom of your HTML file with the following content:

<script type="module">
  import * as hl from "https://esm.sh/jsr/@nktkas/hyperliquid";
</script>

Platform Requirements

circle-info

Node.js: requires v20 or higher.

Node.js 22+ includes native WebSocket support. For earlier versions, install the wsarrow-up-right package if you plan to use WebSocketTransportarrow-up-right:

npm install ws
import WebSocket from "ws";
import * as hl from "@nktkas/hyperliquid";

const transport = new hl.WebSocketTransport({
  reconnect: {
    WebSocket, // Pass WebSocket class from ws package
  },
});
circle-info

React Native: requires polyfills for [`TextEncoder`](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder) and [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget). Install and import them before the SDK:

Last updated