Quickstart
Connect Client
Call Base from the product with UserClient.
Product clients use UserClient. It needs base_url, product_id, and user_token.
import { UserClient } from "@visiblebase/client";
const client = new UserClient({
base_url: "https://base.example.com",
product_id: "prod_xxx",
user_token: "ub_xxx",
});
const models = await client.models();
const result = await client.text({
model: models.primary(),
prompt: "Write a welcome message for the product",
});If you already know the target model, select it directly from the directory:
const body = await client.stream({
model: models("gpt-5.4"),
prompt: "Stream a short paragraph",
});text() returns an AI SDK UIMessage. stream() returns ReadableStream<UIMessageChunk> when the Base-side stream handler returns an AI SDK UIMessage stream response.
One Base can serve many client surfaces:
https://app.example.com- a Chrome extension
- a desktop tool
- a mobile app
- an internal operations tool
Those clients do not need to manage provider keys, model routing, or usage tracking on their own.