New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@inferface/hooks

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inferface/hooks

Headless React hooks for streaming AI interfaces

Source
npmnpm
Version
1.0.0-alpha.2
Version published
Maintainers
1
Created
Source

@inferface/hooks

Headless React hooks for streaming AI interfaces. Zero runtime dependencies.

Install

pnpm add @inferface/hooks
# or
npm install @inferface/hooks

Hooks

  • useStream — low-level SSE/ReadableStream primitive
  • useCompletion — single-turn text completion with streaming
  • useChat — full conversational state with optimistic UI
  • useToolCalls — human-in-the-loop tool call approval flows

Quick start

import { useChat } from "@inferface/hooks";

function Chat() {
  const { messages, send, isLoading } = useChat({ api: "/api/chat" });
  return (
    <div>
      {messages.map(m => <p key={m.id}>{m.content as string}</p>)}
      <button onClick={() => send("Hello")} disabled={isLoading}>Send</button>
    </div>
  );
}

Documentation

Full docs and live demos at inferface.dev

License

MIT

Keywords

react

FAQs

Package last updated on 23 Mar 2026

Related posts