Free components for building your own support agent — bring any backend.Want the agent too? Inflection resolves support requests inside your app.

Hook

useInflection

Chat state and actions from the nearest <InflectionProvider>: messages, streaming, tool activity, confirmations, nudges.

Install

npm i @inflection/sdk-react   #  or: bun add @inflection/sdk-react

A package, not a copy: this is protocol logic, so fixes reach you without re-copying files.

Usage

import { InflectionProvider, useInflection } from "@inflection/sdk-react"

function Chat() {
  const { messages, streaming, busy, send } = useInflection()

  return (
    <>
      <MessageList messages={messages} streaming={streaming} busy={busy} />
      <Composer onSend={send} busy={busy} />
    </>
  )
}

export function App() {
  return (
    <InflectionProvider publishableKey="pk_live_…">
      <Chat />
    </InflectionProvider>
  )
}

Returns

NameTypeDescription
messagesMessage[]The conversation so far, rehydrated on reload.
streamingstringThe in-flight reply's text, cleared once it settles into `messages`.
busybooleanA turn is in flight.
activitystring | nullHuman-readable label for the tool call running now.
pendingConfirmConfirmRequest | nullAn action waiting for approval.
nudge{ title, detail?, ask } | nullThe latest declared per-screen suggestion.
errorstring | nullThe server's own sentence, not a status code.
agentAgentInfo | nullName, conversation starters, whether voice is on.
send(text: string) => voidSend a message. Appends it optimistically.
confirm(callId, approved) => voidResolve a pending confirmation.
navigate(path: string) => voidReport the in-app route, which drives per-screen nudges.
setAuthState(state) => voidReport the host app's auth/wallet state.