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.
Overview
TheHyperstackProvider is the root component that manages WebSocket connections and provides context to all Hyperstack hooks in your React application.
Setup
Wrap your application withHyperstackProvider:
Props
Automatically connect to the stack when hooks are mounted
Wallet adapter for signing transactions (optional)
Array of milliseconds to wait between reconnection attempts
Maximum number of reconnection attempts before giving up
Maximum number of entities to keep in memory per view. When exceeded, oldest entries are evicted.
Interval in milliseconds for batching storage updates (16ms = 60fps)
Optional fallback UI to show while connecting (not commonly used)
Configuration Example
URL Configuration
The WebSocket URL is not configured in the provider. Instead:
- The URL is embedded in your stack definition (
stack.url) - You can override it per-hook using
useHyperstack(stack, { url: 'ws://localhost:3000' })
Context Hooks
These low-level hooks are available but rarely needed:useHyperstackContext
Access the internal Hyperstack context:useConnectionState
Monitor connection state for a specific stack:useView (Low-level)
Direct view access without schema validation:useEntity (Low-level)
Direct entity access by key:Storage Architecture
The provider uses a Zustand-based storage adapter that:- Provides reactive updates to all subscribed components
- Batches updates based on
flushIntervalMsfor performance - Manages connection state globally
- Handles automatic cache eviction when
maxEntriesPerViewis set
Next Steps
React Hooks
Learn about useHyperstack and view hooks
Mutations
Execute instructions with useInstructionMutation