Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/hypertekorg/hyperstack/llms.txt

Use this file to discover all available pages before exploring further.

Installation

Hyperstack provides SDKs for multiple languages. Choose the package that matches your application:

Rust

High-performance client for Rust applications

TypeScript

Framework-agnostic SDK for Node.js and browsers

React

React hooks for easy integration

Python

Python client (work in progress)

Rust

The Rust SDK provides the highest performance option with full type safety.

Install via Cargo

Add to your Cargo.toml:
Cargo.toml
[dependencies]
hyperstack = "0.5"

Package features

The hyperstack crate is an umbrella package that re-exports all components:
Cargo.toml
[dependencies]
# Default: interpreter, macros, and server
hyperstack = "0.5"

# Full installation (includes SDK)
hyperstack = { version = "0.5", features = ["full"] }

# Client SDK only
hyperstack = { version = "0.5", features = ["sdk"] }
FeatureComponentsUse case
defaultinterpreter, macros, serverBuilding stacks
fullinterpreter, macros, server, sdkEverything
sdkClient SDK onlyClient applications
interpreterAST runtimeCustom integrations
macrosStream definition macrosStack development
serverWebSocket serverSelf-hosted deployments

Individual packages

You can also install components individually:
[dependencies]
hyperstack-sdk = "0.5"

Install CLI

The Hyperstack CLI is used for deploying stacks and generating SDKs:
cargo install hyperstack-cli
Verify installation:
hs --version

TLS options

By default, the SDK uses rustls for TLS. Switch to native TLS if needed:
Cargo.toml
[dependencies]
hyperstack-sdk = { version = "0.5", default-features = false, features = ["native-tls"] }

Example usage

main.rs
use hyperstack_sdk::prelude::*;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let hs = HyperStack::connect("wss://mainnet.hyperstack.xyz").await?;
    
    let mut stream = hs.watch::<MyEntity>();
    while let Some(update) = stream.next().await {
        println!("Update: {:?}", update.data());
    }
    
    Ok(())
}

TypeScript

The TypeScript SDK is framework-agnostic and works with Node.js, Vue, Svelte, or vanilla JavaScript.

Install via npm

npm install hyperstack-typescript

Requirements

  • Node.js 16.0.0 or higher
  • TypeScript 5.0 or higher (for TypeScript projects)

Dependencies

The package includes these dependencies:
  • pako - Compression support
  • zod - Runtime type validation

Example usage

main.ts
import { HyperStack } from 'hyperstack-typescript';
import { MY_STACK } from './generated/my-stack';

const hs = await HyperStack.connect('wss://mainnet.hyperstack.xyz', {
  stack: MY_STACK,
});

for await (const update of hs.views.myEntity.list.watch()) {
  console.log('Update:', update.data);
}

Module formats

The package supports both ESM and CommonJS:
// ESM
import { HyperStack } from 'hyperstack-typescript';

// CommonJS
const { HyperStack } = require('hyperstack-typescript');

React

The React SDK provides hooks and components for easy integration with React applications.

Install via npm

npm install hyperstack-react

Requirements

  • Node.js 16.0.0 or higher
  • React 18.0.0 or 19.0.0
  • Zustand 4.0.0 or 5.0.0 (peer dependency)

Peer dependencies

The React SDK requires these peer dependencies:
package.json
{
  "dependencies": {
    "hyperstack-react": "^0.5.3",
    "react": "^18.0.0 || ^19.0.0",
    "zustand": "^4.0.0 || ^5.0.0"
  }
}

Included dependencies

The package automatically includes:
  • hyperstack-typescript - The core TypeScript SDK
  • zustand - State management (also required as peer dependency)

Example usage

App.tsx
import { HyperstackProvider, useHyperstack } from 'hyperstack-react';
import { MY_STACK } from './generated/my-stack';

function App() {
  return (
    <HyperstackProvider autoConnect={true}>
      <Dashboard />
    </HyperstackProvider>
  );
}

function Dashboard() {
  const { views, isConnected } = useHyperstack(MY_STACK);
  const { data } = views.myEntity.list.useOne();
  
  return <div>{data?.name}</div>;
}

Using with Next.js

For Next.js applications, ensure the SDK is imported client-side:
'use client';

import { HyperstackProvider } from 'hyperstack-react';

export default function Providers({ children }) {
  return (
    <HyperstackProvider autoConnect={true}>
      {children}
    </HyperstackProvider>
  );
}

Relationship with hyperstack-typescript

The React SDK depends on and re-exports the core TypeScript SDK. You can import from either package:
// Both work the same
import { HyperStack } from 'hyperstack-react';
import { HyperStack } from 'hyperstack-typescript';

Python

The Python SDK is currently under active development and has not yet been published to PyPI.

Requirements

  • Python 3.9 or higher

Install from source

For development and testing, you can install from source:
git clone https://github.com/HyperTekOrg/hyperstack.git
cd hyperstack/python/hyperstack-sdk
pip install -e .

Planned features

  • Real-time WebSocket streaming
  • Solana program state subscriptions
  • Async/await support
  • Type hints with Pydantic

Example usage (preview)

from hyperstack import HyperstackClient

# Initialize client
client = HyperstackClient()

# Connect and subscribe to program data
await client.connect()
The Python SDK API is subject to change before the initial release. Check the GitHub repository for the latest updates.

Generating SDKs

Once you have a stack deployed, you can generate type-safe SDKs using the Hyperstack CLI.

Prerequisites

Install the CLI (Rust required):
cargo install hyperstack-cli

Generate TypeScript SDK

# List available stacks
hs sdk list

# Generate TypeScript SDK
hs sdk create typescript my-stack

# With custom output directory
hs sdk create typescript my-stack --output ./generated
This creates a typed SDK in ./generated/my-stack-stack/.

Generate Rust SDK

hs sdk create rust my-stack

# With custom output and crate name
hs sdk create rust my-stack --output ./crates/my-sdk --crate-name my-sdk
Add the generated crate to your Cargo.toml:
Cargo.toml
[dependencies]
hyperstack-sdk = "0.5"
my-stack = { path = "./generated/my-stack-stack" }

SDK structure

Generated SDKs include:
  • Type definitions: Structs and schemas for all entities
  • View accessors: Typed methods for accessing views
  • Entity traits: Implementations for streaming and querying

Version compatibility

All Hyperstack packages follow synchronized versioning:
PackageVersionRegistry
hyperstack0.5.3crates.io
hyperstack-sdk0.5.3crates.io
hyperstack-cli0.5.3crates.io
hyperstack-typescript0.5.3npm
hyperstack-react0.5.3npm
hyperstack-sdk (Python)unreleasedPyPI
Client SDKs are forward-compatible with minor version bumps. Server version 0.5.x works with client versions 0.5.0 through 0.5.x.

Next steps

Quickstart

Build your first Hyperstack application

CLI Reference

Learn how to deploy and manage stacks

Core Concepts

Understand stacks, views, and projections

Stack API

Explore the complete API reference

Build docs developers (and LLMs) love