HyperFlow Client SDK Guide
Overview
The HyperFlow Client SDK is a JavaScript/TypeScript library that simplifies building custom applications powered by HyperFlow flow-graphs. It handles all the complexity of the Control API communication, state management, streaming, and interaction lifecycle, letting you focus on your application's UI and business logic.
What It Provides:
- Core SDK: Headless client for any JavaScript environment (browser, Node.js, React Native)
- React Integration: Hooks and state management for React applications
- Type Safety: Full TypeScript support with complete type definitions
- Production-Tested: Based on HyperFlow's own embeddable chatbot implementation
Why Use the SDK?
Without SDK (Direct Control API):
- 800+ lines of integration code
- Manual management of interaction specs, step indices, streaming loops
- Easy to get wrong (missing paramSpec, tight polling, etc.)
- See: Building Custom Apps for the manual approach
With SDK:
- 50 lines of code
- All Control API complexity handled automatically
- Correct patterns guaranteed (long-polling, streaming, state management)
- Just configure and use
// Without SDK: 800+ lines of complex polling, state management, spec handling...
// With SDK:
const { messages, sendMessage, isReady } = useHyperFlow({
apiKey: 'hf_...',
flowGraphID: '67ca914369e9b8a95c967fdf',
});
// Done! Everything just works.