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

@agentkit-react/core

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agentkit-react/core

Ship AI chat in 10 lines of React. Drop-in hooks and components for streaming AI interfaces.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

AgentKit

Ship AI chat in 10 lines of React.

npm version bundle size license

Drop-in hooks and components for streaming AI interfaces. Works with Claude, GPT, Vercel AI SDK, or any LLM. So simple an AI agent can write it for you.

Install

npm install @agentkit-react/core

10-Line Chat

import { useChat, ChatContainer, Message, InputBar } from '@agentkit-react/core'
import { anthropic } from '@agentkit-react/core/adapters'
import '@agentkit-react/core/theme'

function Chat() {
  const chat = useChat({
    adapter: anthropic({ apiKey: 'your-key', model: 'claude-sonnet-4-6' }),
  })
  return (
    <ChatContainer>
      {chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
      <InputBar chat={chat} />
    </ChatContainer>
  )
}

That's it. Streaming, auto-scroll, keyboard handling, light/dark theme — all included.

Why AgentKit?

AgentKitVercel AI SDKassistant-ui
API surface3 hooksFull toolkit50+ components
Setup10 lines~30 lines~50 lines
HeadlessYesNo UI includedOpinionated
Agent-friendlyEntire API fits in 2K tokensLarge docs surfaceLarge docs surface
Bundle<5KB~30KB~80KB

Swap providers in one line

import { anthropic, openai, vercelAI, generic } from '@agentkit-react/core/adapters'

// Claude
useChat({ adapter: anthropic({ apiKey, model: 'claude-sonnet-4-6' }) })

// GPT
useChat({ adapter: openai({ apiKey, model: 'gpt-4o' }) })

// Vercel AI SDK (route handler)
useChat({ adapter: vercelAI({ api: '/api/chat' }) })

// Any ReadableStream
useChat({ adapter: generic({ send: async (msgs) => fetch('/api', { body: JSON.stringify(msgs) }).then(r => r.body!) }) })

Works everywhere

Next.js (App Router)

// app/chat/page.tsx
'use client'
import { useChat, ChatContainer, Message, InputBar } from '@agentkit-react/core'
import { anthropic } from '@agentkit-react/core/adapters'
import '@agentkit-react/core/theme'

export default function ChatPage() {
  const chat = useChat({ adapter: anthropic({ apiKey: process.env.NEXT_PUBLIC_API_KEY!, model: 'claude-sonnet-4-6' }) })
  return (
    <ChatContainer>
      {chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
      <InputBar chat={chat} />
    </ChatContainer>
  )
}

Vite

// src/App.tsx
import { useChat, ChatContainer, Message, InputBar } from '@agentkit-react/core'
import { openai } from '@agentkit-react/core/adapters'
import '@agentkit-react/core/theme'

function App() {
  const chat = useChat({ adapter: openai({ apiKey: import.meta.env.VITE_OPENAI_KEY, model: 'gpt-4o' }) })
  return (
    <ChatContainer>
      {chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
      <InputBar chat={chat} />
    </ChatContainer>
  )
}

Remix

// app/routes/chat.tsx
import { useChat, ChatContainer, Message, InputBar } from '@agentkit-react/core'
import { vercelAI } from '@agentkit-react/core/adapters'
import '@agentkit-react/core/theme'

export default function Chat() {
  const chat = useChat({ adapter: vercelAI({ api: '/api/chat' }) })
  return (
    <ChatContainer>
      {chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
      <InputBar chat={chat} />
    </ChatContainer>
  )
}

TanStack Start

// src/routes/chat.tsx
import { useChat, ChatContainer, Message, InputBar } from '@agentkit-react/core'
import { anthropic } from '@agentkit-react/core/adapters'
import '@agentkit-react/core/theme'

export default function Chat() {
  const chat = useChat({ adapter: anthropic({ apiKey: 'your-key', model: 'claude-sonnet-4-6' }) })
  return (
    <ChatContainer>
      {chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
      <InputBar chat={chat} />
    </ChatContainer>
  )
}

The entire API

3 Hooks

// Stream any async source
const { text, status, error, stop } = useStream(source)

// Reactive state (proxy-based, minimal re-renders)
const state = useReactive({ count: 0 })

// Full chat session
const chat = useChat({ adapter })

7 Components

<ChatContainer>         {/* scrollable chat layout */}
<Message message={m} /> {/* chat bubble with streaming */}
<InputBar chat={chat} /> {/* input + send */}
<Markdown content={s} /> {/* markdown renderer */}
<CodeBlock code={s} language="ts" copyable />
<ToolCallView toolCall={tc} />
<ThinkingIndicator visible />

Headless + Optional Theme

Components ship unstyled with data-ak-* attributes. Import the theme for instant polish:

import '@agentkit-react/core/theme' // light/dark, CSS custom properties

Override any token:

:root {
  --ak-color-bubble-user: #10b981;
  --ak-radius: 16px;
}

For AI Agents

The entire API fits in under 2,000 tokens. See the agent-friendly reference — paste it into your LLM context and start generating chat UIs.

Credits

Inspired by Arrow.js — the first UI framework for the agentic era.

License

MIT

Keywords

react

FAQs

Package last updated on 02 Apr 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