Transport & Endpoints
This page explains the network paths used by the TypeScript SDK.
kalam-link abstracts transport details, but understanding endpoint mapping helps debugging and observability.
Base URL
http://localhost:8080HTTP endpoints used by SDK
| Method | Path | Description |
|---|---|---|
GET | /v1/api/healthcheck | Server health check |
POST | /v1/api/sql | Execute SQL statements |
POST | /v1/api/auth/login | Authenticate and receive JWT |
New detailed references
Use these two pages as the canonical transport references:
- HTTP API Reference: Route map, auth rules, request/response payloads, SQL/file/topic endpoints, and error codes.
- WebSocket Protocol: Upgrade/auth handshake, subscribe lifecycle, message schema, limits, timeouts, and protocol errors.
If you are building a backend integration, start with HTTP API Reference. If you are implementing realtime stream handling, start with WebSocket Protocol.
Execute SQL
curl -X POST http://localhost:8080/v1/api/sql \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '{"sql": "SELECT * FROM chat.messages LIMIT 10"}'Health check
curl http://localhost:8080/v1/api/healthcheckWebSocket transport
Realtime subscriptions are handled by the WASM client and WebSocket internals inside KalamDBClient.
In app code, use:
await client.connect();
await client.subscribeWithSql('SELECT * FROM app.messages', callback);Connection Flow
- Initialize WASM and auth mode
- Open WebSocket connection (
connect()) - Send subscription SQL (
subscribeWithSql()) - Receive
subscription_ack,initial_data_batch, andchangeevents - Call returned unsubscribe function or
unsubscribe(id)
SDK method → transport mapping
| SDK Method | Transport |
|---|---|
query() | HTTP /v1/api/sql via WASM client |
queryWithFiles() | direct multipart HTTP /v1/api/sql |
login() | HTTP /v1/auth/login via WASM client |
connect() | WebSocket connect via WASM client |
subscribeWithSql() | WebSocket subscription stream |
consumeBatch() | topic consume request via WASM client |
ack() | topic ack request via WASM client |
For complete usage patterns, continue with:
Last updated on