@captra-ai/client
v0.10.0
Published
HTTP and streaming client for Captra runtimes.
Readme
@captra-ai/client
Typed HTTP, SSE streaming, approvals, cancellation, event retrieval, and replay for a remote Captra runtime.
npm install @captra-ai/client @captra-ai/coreimport { createCaptraClient } from '@captra-ai/client'
import type app from './captra.app'
const client = createCaptraClient<typeof app>({ baseUrl: '/api/captra' })
const result = await client.execute('greet', { name: 'Ada' })Capability names, inputs, and outputs are inferred from the server's app contract. Use stream() when you need trace or chat.delta events before the final structured result. Its fourth argument accepts an AbortSignal for per-request cancellation.
conversationMessages(id, { cursor, limit }) reads authenticated cursor pages for durable chat interfaces.
Use conversation(id), archiveConversation(id), restoreConversation(id), and deleteConversation(id) for the authenticated conversation lifecycle.
Client documentation · GitHub · MIT
