agentskit.js

@agentskit/solid — for agents

SolidJS binding — `useChat` hook backed by createStore for fine-grained reactivity.

#Purpose

SolidJS binding for the ChatReturn contract from @agentskit/core. Same shape as React/Vue/Svelte hooks — store-backed, cleanup wired via onCleanup.

#Install

npm install @agentskit/solid
# peer:
npm install solid-js

#Primary exports

  • useChat(config): ChatReturn — Solid hook backed by createStore + onCleanup.

#Minimal example

import { useChat } from '@agentskit/solid'
import { anthropic } from '@agentskit/adapters'

const adapter = anthropic({ apiKey: import.meta.env.VITE_ANTHROPIC_KEY, model: 'claude-sonnet-4-6' })

export function Chat() {
  const chat = useChat({ adapter })
  return (
    <div>
      <ul>{chat.messages.map(m => <li>{m.role}: {m.content}</li>)}</ul>
      <button onClick={() => chat.send('Hello')}>Send</button>
    </div>
  )
}

#Common patterns

  • Reactivity: Solid stores are fine-grained — access chat.messages directly inside JSX, not destructured.
  • SSR: useChat is client-only. Wrap in <ClientOnly> for SolidStart SSR.
  • Cleanup: subscriptions tear down via onCleanup; no manual unsubscribe needed.

#Source

Explore nearby

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page