Install the package
npm install @polyester/sdk
# or
bun add @polyester/sdk
# or
pnpm add @polyester/sdkPre-release package name
The SDK is not yet published to npm. These docs use
@polyester/sdk as the package
name; until the first public release, consume the package from a repository checkout.Requirements
- Runtime — any modern JavaScript runtime with the
fetchand WebCrypto globals: Node.js 20+, Bun, Deno, Cloudflare Workers, and evergreen browsers all work. - Module system — the package is ESM-only (
"type": "module"). - TypeScript — TypeScript 5+ with
"moduleResolution": "bundler"(or"nodenext") so the subpath exports (@polyester/sdk/account-signer, …) resolve.
The SDK talks to the API over ConnectRPC (HTTP) and Centrifugo (WebSocket). Realtime subscriptions are browser/long-lived-process features — see Streaming for the server-side caveats.
Verify the install
The testnet environment ships with the SDK, and market data needs no credentials:
import { PolyesterClient, POLYESTER_TESTNET_ENVIRONMENT } from "@polyester/sdk";
const client = new PolyesterClient({ environment: POLYESTER_TESTNET_ENVIRONMENT });
const { markets } = await client.marketOverview.list({ limit: 5 });
for (const market of markets) {
console.log(market.symbol, market.lastPrice);
}If this prints a handful of markets and prices, you are connected. Next: Quickstart takes you through authentication and your first order.