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.

Quickstart

This guide will get you streaming Solana data in under 5 minutes. We’ll connect to a live stack and display real-time updates.
This quickstart uses the Ore mining stack as an example. You can follow the same pattern with any Hyperstack deployment.

Choose your path

Select your preferred framework to get started:

React quickstart

Build a React application that streams live Ore mining data.
1

Install dependencies

npm install hyperstack-react
2

Set up the provider

Wrap your app with HyperstackProvider to enable real-time streaming:
App.tsx
import { HyperstackProvider } from 'hyperstack-react';
import { Dashboard } from './Dashboard';

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

Stream data with hooks

Use the useHyperstack hook to access views and stream real-time data:
Dashboard.tsx
import { useHyperstack } from 'hyperstack-react';
import { ORE_STREAM_STACK } from 'hyperstack-stacks/ore';

export function Dashboard() {
  const { views, isConnected } = useHyperstack(ORE_STREAM_STACK);
  const { data: latestRound } = views.OreRound.latest.useOne();
  const { data: treasury } = views.OreTreasury.list.useOne();

  return (
    <div>
      <h1>Ore Mining Dashboard</h1>
      <p>Status: {isConnected ? 'Connected' : 'Disconnected'}</p>
      
      {latestRound && (
        <div>
          <h2>Latest Round</h2>
          <p>Round #{latestRound.id.round_id}</p>
          <p>Motherlode: {latestRound.state?.motherlode}</p>
          <p>Total Deployed: {latestRound.state?.total_deployed}</p>
        </div>
      )}
      
      {treasury && (
        <div>
          <h2>Treasury</h2>
          <p>Balance: {treasury.state?.balance}</p>
          <p>Total Staked: {treasury.state?.total_staked}</p>
        </div>
      )}
    </div>
  );
}
4

Run your app

npm run dev
Your app will connect to the Hyperstack server and display real-time updates as new blocks are mined!

Key concepts

  • HyperstackProvider: Root provider that manages the WebSocket connection
  • useHyperstack(stack): Hook to access views for a specific stack
  • .useOne(): Subscribe to a single entity with automatic updates
  • isConnected: Track connection state
The React SDK automatically handles reconnection, state synchronization, and cleanup when components unmount.

What’s next?

Core concepts

Learn about stacks, views, and projections

Stack API

Explore the complete client API reference

Deploy your stack

Learn how to deploy your own stack

View examples

Browse complete example applications

Build docs developers (and LLMs) love