SDK

JavaScript SDK

Use the JavaScript SDK for server-side apps, workers, and API integrations.

Client initialization

Initialize one client per process and reuse it. This keeps connection overhead low and centralizes retry and timeout policy.

Prefer environment-variable configuration for endpoint URLs and API keys.

Create client
import { TellodbClient } from "tellodb";

const client = TellodbClient.fromCloud({
  baseUrl: process.env.TELLODB_URL!,
  apiKey: process.env.TELLODB_API_KEY!
});

Ingest and query

Basic flow
await client.ingest({
  entity_id: "user-123",
  text: "I switched to pour-over coffee last month."
});

const results = await client.query(
  "What coffee style do I use now?",
  { entity_id: "user-123", limit: 5 }
);

Production patterns

  • Set request deadlines per endpoint class.
  • Use circuit breakers for dependency outages.
  • Attach request IDs for traceability.
  • Implement idempotent ingest retries.