@agentup-inksen/web-chat-core
v0.0.7
Published
Shared SDK for AgentUp web chat clients (REST + SignalR + types)
Downloads
112
Readme
@agentup-inksen/web-chat-core
Framework-agnostic SDK that the AgentUp web chat clients (@agentup-inksen/web-chat-app, the bubble widget, future React Native clients) build on top of.
import { AgentUpChatClient, AgentUpChatHub } from '@agentup-inksen/web-chat-core';
const api = new AgentUpChatClient({
apiUrl: 'https://api.example.com',
visitorToken: visitorJwtFromHost,
tenantId: 'acme'
});
const agents = await api.listAgents();
const conversations = await api.listConversations();
const hub = new AgentUpChatHub(
{ apiUrl: 'https://api.example.com', accessTokenFactory: () => visitorJwtFromHost },
{
onMessage: (msg) => console.log('new', msg),
onConnectionStateChanged: (s) => console.log('state', s)
}
);
await hub.start();
await hub.joinConversation(conversations[0].id);Build:
npm install
npm run build