Features
- Type-safe client — Full TypeScript support with accurate type inference
- Multiple usage patterns — One-shot runs, streaming responses, and multi-turn sessions
- React hooks — Pre-built
useAgenthook for chat interfaces - Streaming support — Real-time text streaming and tool call events via Server-Sent Events
- Error handling — Structured error types with status codes and details
- Automatic session management — Sessions auto-cleanup after 29 minutes of inactivity
Quick Start
Install the SDK:Basic Usage
- One-shot
- Streaming
- Multi-turn Session
- React
Package Structure
The SDK is published as a single package with multiple entry points:@superserve/sdk— Core client, session, and streaming functionality@superserve/sdk/react— React hooks and components
Core Concepts
Client
TheSuperserve class is the main entry point. Initialize it with your API key and use it to run agents or create sessions.
Sessions
Sessions enable multi-turn conversations with an agent. Messages sent within a session share context and history. Sessions automatically timeout after 29 minutes of inactivity.Streaming
Agent responses can be streamed in real-time using Server-Sent Events. TheAgentStream class provides async iterators for consuming events as they arrive.
Tool Calls
When agents use tools, the SDK tracks each invocation including name, input, and execution duration. These are included in the finalRunResult.
Next Steps
Installation
Install the SDK and configure authentication
Client Reference
Learn about the Superserve client class
Sessions
Build multi-turn conversations
Streaming
Handle real-time agent responses
React Hooks
Build chat interfaces with React