Skip to main content

Overview

@structbuild/sdk is the official TypeScript SDK for the Struct API. It wraps the REST API, the rooms websocket, the alerts websocket, and webhook management in a single, fully-typed client. The SDK is dual-published as ESM and CJS, runs in Node, Bun, Deno, and browsers, and ships with generated types derived directly from the live OpenAPI and AsyncAPI specs. Source: github.com/structbuild/struct-typescript-sdk. For a high-level tour of every surface and a feature matrix versus raw HTTP, see SDK Overview.

Install

Quickstart

1

Create an account

Sign up at struct.to/dashboard and create an organisation.
2

Generate an API key

Open the API Keys page in your dashboard and create a new key. Copy the value somewhere safe; you won’t be able to view it again. See Authentication for key types, JWT public keys, and rotation.
3

Instantiate the client

4

Make your first request

5

Stream live updates

What’s included

REST client

Namespaced access to every endpoint: markets, events, trader, holders, order book, series, assets, tags, bonds, search, and webhooks.

WebSocket rooms

Typed subscribe / on for every room, with auto-reconnect, replay, and keepalive.

Alerts

Per-event typed filters for the alerts websocket, sharing the same connection primitives.

JWT public key auth

Authenticate your end users with their own JWTs without shipping sk_* keys to the browser.

Pagination helper

Iterate through any paginated endpoint with a single async generator.

Typed errors

HttpError, TimeoutError, NetworkError, WebSocketError, and friends.

Requirements

The SDK targets modern runtimes that support the Fetch API, AbortController, and native WebSocket. That covers Node 18+, Bun, Deno, Cloudflare Workers, and every evergreen browser. No polyfills are required.

Next steps

Last modified on May 27, 2026