> ## Documentation Index
> Fetch the complete documentation index at: https://docs.larksh.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lark SDK overview

> The native JavaScript/TypeScript SDK for Lark

# 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.

```typescript theme={null}
import { LarkDatabase } from "@lark-sh/client";

const db = new LarkDatabase("my-project/my-database", { anonymous: true });

// on() returns an unsubscribe function — no need to await connect() first
const unsubscribe = db.ref("scores").on("value", (snapshot) => {
  console.log(snapshot.val());
});

// Clean up when you're done
unsubscribe();
```

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

```bash theme={null}
npm install @lark-sh/client
```

Or with your preferred package manager:

```bash theme={null}
yarn add @lark-sh/client
pnpm add @lark-sh/client
```

## 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.

| Platform                                        | Support      |
| ----------------------------------------------- | ------------ |
| Modern browsers (Chrome, Firefox, Safari, Edge) | Full support |
| Node.js 18+                                     | Full support |
| React Native                                    | Full support |
| Deno                                            | ESM import   |

## Package

Everything you need is in a single package:

```typescript theme={null}
import { LarkDatabase, ServerValue } from "@lark-sh/client";
```

<Tip>
  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](/lark-sdk/fb-v8) for details.
</Tip>

## What's next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/lark-sdk/quickstart">
    Connect, write, read, and subscribe in under five minutes.
  </Card>

  <Card title="Connecting" icon="plug" href="/lark-sdk/connecting">
    Connection options, transports, and lifecycle events.
  </Card>

  <Card title="Writing data" icon="pen" href="/lark-sdk/writing">
    Set, update, remove, push, and multi-path writes.
  </Card>

  <Card title="Subscriptions" icon="bell" href="/lark-sdk/subscriptions">
    Listen for real-time changes with different event types.
  </Card>
</CardGroup>
