TypeScript SDK Packages
KalamDB has separate TypeScript packages for separate jobs. Pick one package path, copy the first example, then move to the package docs when you need more detail.
Which Package Should I Use?
| Job | Install | Start here |
|---|---|---|
| Query SQL, login, upload files, subscribe to rows | @kalamdb/client | Setup & Quick Start |
Use Drizzle tables or generate schema.ts | @kalamdb/client @kalamdb/orm drizzle-orm | Drizzle ORM & Generator |
| Build React live-query hooks and components | @kalamdb/client @kalamdb/react plus @kalamdb/orm drizzle-orm for typed mode | React Live Queries |
| Consume topics, ACK messages, run agents | @kalamdb/client @kalamdb/consumer | Topic Consumers & ACK |
| Install the terminal CLI through npm | npm install -g @kalamdb/cli | Kalam CLI |
@kalamdb/cli is published from the TypeScript package tree because npm is one of the supported
distribution channels, but it is documented with the server guides because it is an operational
client rather than an in-app SDK dependency.
Fast Start: App Client
Use @kalamdb/client in browser apps, Next.js apps, scripts, and API services.
Copy this smoke test:
Use it for:
query(),queryOne(),queryAll(), andqueryRows()login()andrefreshToken()live(),liveTable(), andliveEvents()queryWithFiles()for FILE uploads
Realtime subscriptions have two documented usage modes in the client API:
simple: uselive()orliveTable()and let the SDK materialize the latest row set for you. Read: Simple Realtime Modeadvanced: useliveEvents()when you want raw events,change_type, and batch metadata. Read: Advanced Realtime Mode
Fast Start: ORM Package
Use @kalamdb/orm when you want typed tables and Drizzle-style queries. It sits on top of @kalamdb/client; it is not a second connection layer.
Generate a schema from a running KalamDB server:
Keep that file fresh in local dev with the CLI schema watcher:
Query with the generated table:
Read next: Drizzle ORM & Generator.
Fast Start: Consumer Package
Use @kalamdb/consumer only in workers or agents that consume topics. Keep this code out of browser bundles.
Copy this worker skeleton:
Read next: Topic Consumers & ACK and Consumer Runtime.
Fast Start: React Package
Use @kalamdb/react when a React app wants live rows, typed mutations, aggregate multi-query state, or assistant workflow composition.
Read next: React Live Queries.
How Packages Work Together
Use this split in real projects:
- UI code imports
@kalamdb/client. - Typed table code imports
@kalamdb/ormplus the app client. - Worker code imports
@kalamdb/consumer. - React helpers live in
@kalamdb/reactso the base client stays framework-neutral.
Common Paths
| I want to… | Read |
|---|---|
| Run the first query | Setup & Quick Start |
| Subscribe to rows for a UI | Realtime Subscriptions, Simple Realtime Mode, and Advanced Realtime Mode |
| Build a React live-query screen | React Live Queries |
| Generate typed tables | Drizzle ORM & Generator |
| Build a topic worker | Topic Consumers & ACK |
| Build a retrying worker | Consumer Runtime |
| Copy full example flows | Examples and Cookbook |