@taskcast/client
v1.5.0
Published
Browser SSE subscription client for Taskcast.
Downloads
1,147
Readme
@taskcast/client
Browser SSE subscription client for Taskcast. Subscribe to task event streams with automatic reconnection and cursor-based resumption.
Install
pnpm add @taskcast/clientUsage
import { TaskcastClient } from '@taskcast/client'
const client = new TaskcastClient({
baseUrl: 'http://localhost:3721',
token: 'your-jwt-token', // optional
})
const taskId = 'task-123' // replace with your actual task ID
await client.subscribe(taskId, {
filter: {
types: ['llm.*'],
since: { index: 0 },
},
onEvent: (envelope) => {
console.log(envelope.data) // { text: "Once upon a time..." }
},
onDone: (reason) => {
console.log(`Task ${reason}`) // "Task completed"
},
})Features
- SSE-based real-time event streaming
- Wildcard type filtering (
llm.*,tool.call) - Cursor-based resumption (by event ID, index, or timestamp)
- Automatic reconnection on disconnect
Part of Taskcast
This is the browser client package. See the Taskcast monorepo for the full project. For React integration, see @taskcast/react.
