Skip to Content
Realtime Ops Feed

Realtime Ops Feed

The smallest useful browser example for the TypeScript SDK — one React component, no wrapper layers.

Source: examples/simple-typescript/

What it does

  • Reads rows with queryAll()
  • Subscribes to live updates with live()
  • Authenticates in the browser with Auth.basic() and the SDK’s built-in JWT exchange

Open the app in two browser tabs, add an event in one tab, and the second tab updates immediately.

Prerequisites

  • Node.js 18+
  • KalamDB running on http://127.0.0.1:2900

Quick start

BASH
cd examples/simple-typescriptnpm installnpm run setupnpm run dev

Open http://127.0.0.1:5173.

The setup script creates:

  • namespace demo
  • user table demo.activity_feed
  • local user demo-user / demo123
  • .env.local with browser credentials

What to try

  1. Open the app in two tabs side by side.
  2. Submit a new event in one tab.
  3. Watch the same row appear in the other tab without refreshing.

Files worth reading

FilePurpose
src/App.tsxComplete example — query, live subscription, and form submit
activity-feed.sqlSchema used by the app
setup.mjsCreates namespace, table, user, and .env.local

Verify it works

BASH
npm test

The Playwright test opens two pages, submits an event, and confirms both tabs show the same live row.

Troubleshooting

Cannot connect to KalamDB

BASH
curl http://127.0.0.1:2900/health

Missing credentials

Re-run npm run setup to regenerate .env.local, then restart the dev server.

Next steps

Last updated on