Skip to Content
🚀 KalamDB v0.3.0-alpha2 is out — Learn more
SDK & ClientTransport & Endpoints

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:8080

HTTP endpoints used by SDK

MethodPathDescription
GET/v1/api/healthcheckServer health check
POST/v1/api/sqlExecute SQL statements
POST/v1/api/auth/loginAuthenticate 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/healthcheck

WebSocket 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

  1. Initialize WASM and auth mode
  2. Open WebSocket connection (connect())
  3. Send subscription SQL (subscribeWithSql())
  4. Receive subscription_ack, initial_data_batch, and change events
  5. Call returned unsubscribe function or unsubscribe(id)

SDK method → transport mapping

SDK MethodTransport
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