@sveda-ai/core
npm package
CLIENT
Install @sveda-ai/core. SvedaClient holds endpoints, headers, and tools. session.send posts a turn. Streaming stays on the wire — not a Vue widget, not a Laravel package.
@sveda-ai/core
npm package
send
session API
JS
any host
Most “embed an agent” kits are a widget, a framework plugin, or a stream helper that still leaves you writing the attach surface. The host should own a client object — not a Vue island and not a PHP package in the request cycle.
A Vue-only SDK forces the copilot into one renderer. @sveda-ai/vue exists as optional UI. Core is plain JavaScript and attaches wherever fetch exists.
session.stream sounds like the product. The wire is a POST. SvedaChatSession exposes send. Streaming is the response, not a second client API.
Laravel packages and server middleware pull the loop into your routes. SvedaClient talks to sveda-server over HTTP. Your deploy stays yours.
Construct SvedaClient with endpoints, headers, and optional registries. Open a session by chat id. Call send. The client sets Accept to application/vnd.sveda.stream+json and reads the SSE body.
Endpoints, headers, tools, and context live on the client — not scattered across composables.
A turn is text plus optional context, model, provider, and files. The session holds messages and status while the stream runs.
Pass a SvedaToolRegistry or use the default on the client. Handlers run in the host when a tool.call targets frontend.
import { SvedaClient } from "@sveda-ai/core";
const client = new SvedaClient({
endpoints: { stream: "/sveda/stream" },
headers: { "x-sveda-embed-token": token },
});
const session = client.session(chatId);
await session.send("Ship a copilot into the product."); Sveda is not a chatbot SaaS and not a Laravel package. You install @sveda-ai/core, point stream at your proxy or at sveda-server, and mint a visitor token on the host. The browser only sends x-sveda-embed-token or Authorization: Bearer sveda_embed_….
Optional packages stop at UI. @sveda-ai/vue can provide a panel. It is not required to send a turn. Histories and document extract hang off the same client when you configure those endpoints.
Read the JS client docs for options. The product copilot page maps the same attach path onto a live host.
POST /sveda/stream
Accept: application/vnd.sveda.stream+json
x-sveda-embed-token: sveda_embed_…
session.send → text.delta → message.end
Rust runtime
sveda-server binds 0.0.0.0:8787. The client never owns the agent loop.
Stream protocol
session.send reads SSE events. The verb on the session is still send.
Embed token
Mint sveda_embed_ on the host. Pass it in headers on SvedaClient.
Host SDKs
Mint from PHP, Python, Node, or without a framework.
JS client docs
SvedaClient options, session.send, and SvedaToolRegistry.
Get started
Install core, run the runtime, send the first turn.
Product copilot
Attach the client inside a product you already ship.
npm install @sveda-ai/core. Construct SvedaClient. Call session.send. Vue is optional.