🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@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

latest
Source
npmnpm
Version
1.0.0-alpha.1
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 15 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts