Zero Dependencies
Uses native fetch + ReadableStream. No heavy SDKs needed.
react-sse-chat is a lightweight React hook for consuming Server-Sent Events (SSE) from AI chat backends. Zero runtime dependencies — it uses native fetch + ReadableStream under the hood.
A single hook — useChat — that handles everything needed to build a streaming chat UI:
parts managed for youdata: {JSON}\n\n formatted eventstool_call, text_delta, or any event type you defineparts array (text, tool calls, etc.) for flexible renderingZero Dependencies
Uses native fetch + ReadableStream. No heavy SDKs needed.
Simple API
One hook, one line: useChat({ api }). Messages, loading, and streaming handled for you.
Custom Events
Handle text_delta, tool_call, or any custom SSE event with onEvent.
Standalone Parser
The SSE parser is exported separately for advanced use cases outside React.