Skip to main content

Lark SDK

The Lark SDK (@lark-sh/client) is the official JavaScript/TypeScript client for Lark databases. It gives you real-time data synchronization, offline support, and a modern developer experience in a lightweight package.

Lark SDK Features

The entire SDK is ~20KB gzipped. Subscriptions return an unsubscribe function directly, so there’s no need to track callbacks or call a separate off() method. This plays nicely with React’s useEffect cleanup, Vue’s onUnmounted, and any other framework lifecycle pattern.
The SDK connects over WebSocket by default. You can opt in to WebTransport (HTTP/3) for lower latency and better multiplexing in supported browsers by setting transport: 'auto'. Ephemeral data like cursor positions, typing indicators, and player coordinates can flow through volatile paths, which are high-frequency updates that skip persistence for maximum speed. Every method, option, and return value is fully typed with TypeScript.

Installation

Or with your preferred package manager:

Platform support

The Lark SDK works in browsers and Node.js. Both CommonJS and ESM builds are included, and your bundler or runtime will pick the right one automatically.

Package

Everything you need is in a single package:
If you’re migrating from Firebase v8, the SDK also ships a compatibility layer at @lark-sh/client/fb-v8. See the Firebase v8 compatibility page for details.

What’s next

Quickstart

Connect, write, read, and subscribe in under five minutes.

Connecting

Connection options, transports, and lifecycle events.

Writing data

Set, update, remove, push, and multi-path writes.

Subscriptions

Listen for real-time changes with different event types.