Appearance
@convosite/client
@convosite/client is the small, framework-agnostic JavaScript and TypeScript client for building Convosite experiences in your application.
It handles two developer-facing runtime jobs:
- starting and continuing streamed conversations
- running public Endpoints
It also includes a low-level request() escape hatch for public Convosite API routes that are not wrapped by the client yet.
Keep presentation in your application
Convosite returns structured conversational data. Your application decides how that data is rendered, styled and interacted with.
What the client does
A typical application creates one client for a Convosite Site:
ts
import { createConvosite } from '@convosite/client'
const convosite = createConvosite({
site: 'YOUR_SITE_ULID',
})From there you can create a conversation:
ts
const conversation = convosite.conversations.create()
for await (const event of conversation.send('What services do you offer?')) {
console.log(event)
}Or run an Endpoint:
ts
await convosite.actions.run('ENDPOINT_ULID', {
name: 'Joe',
email: '[email protected]',
message: 'Hello',
})What the client does not do
The client is deliberately not a headless CMS SDK. It does not expose public APIs for Pages, Menus or Knowledge.
Knowledge is managed in Convosite and retrieved internally by the conversation runtime. Your frontend consumes the structured result of that conversation rather than querying Knowledge directly.
Framework support
The package has no runtime dependencies and uses the platform fetch API. It can therefore be used with modern browser and JavaScript environments including Vue, React, Nuxt, Next.js, Svelte, SvelteKit, Astro, Bun and Node.js 18+.
Next steps
Start with Installation, then configure the client and create your first Conversation.