Skip to content

react-sse-chat

A lightweight React hook for consuming SSE from AI chat backends. Zero dependencies.

Zero 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.