---
title: "Installation"
description: "Package version, supported runtimes, optional peers, and subpath exports."
---

> Documentation Index
> Fetch the complete documentation index at: https://logbun-docs.abshahin.workers.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

**Package version:** `1.1.0` (from `package.json`). **License:** MIT. **Engines:** Node.js `>=18`. The repository’s unit-test runner in CI is Bun 1.4.0; that is not a consumer engine constraint.

```sh
npm install logbun
pnpm add logbun
yarn add logbun
bun add logbun
```

Deno imports the npm artifact (`npm:logbun`). Grant filesystem permissions when using filesystem durability — see [Deno](/guides/deno).

## Optional peers

Install only what you import. All of these are optional in `package.json` `peerDependenciesMeta`.

```sh
npm install @libsql/client
pnpm add @libsql/client
yarn add @libsql/client
bun add @libsql/client
```
```sh
npm install @clickhouse/client
pnpm add @clickhouse/client
yarn add @clickhouse/client
bun add @clickhouse/client
```
```sh
npm install elysia
pnpm add elysia
yarn add elysia
bun add elysia
```
```sh
npm install hono
pnpm add hono
yarn add hono
bun add hono
```

`BunSQLiteAdapter` has no npm peer; it imports `bun:sqlite` and only runs on Bun.

Peer ranges declared by the package:

| Peer | Range |
|------|-------|
| `@libsql/client` | `>=0.6.0` |
| `@clickhouse/client` | `>=1.0.0` |
| `elysia` | `>=1.0.0` |
| `hono` | `>=4.0.0` |

## Package exports

```text
logbun
logbun/durability/filesystem    # Node / Bun / Deno (node:fs)
logbun/durability/cloudflare    # Workers Durable Object SQLite (ESM-only; no CJS)
logbun/adapters/bun-sqlite
logbun/adapters/turso
logbun/adapters/clickhouse
logbun/adapters/cloudflare-analytics-engine
logbun/plugins/elysia
logbun/plugins/hono
```

The root graph is ES2022 / Web APIs: no `node:`, `bun:`, or `process`. Runtime-specific storage is reached only through the durability and adapter subpaths.

`logbun/durability/cloudflare` has an `import` condition only. There is no `require` / CJS export.

## Runtime matrix

| | Volatile (root default) | File reliability | CF DO reliability |
|--|-------------------------|------------------|-------------------|
| Runtimes | Node, Bun, Deno, Workers | Node, Bun, Deno | Workers Durable Object |
| Journal | no (optional in-process memory) | WAL segments | DO SQLite |
| DLQ | memory | files + opaque IDs | DO SQLite |
| Survive process death | no | yes | yes |
| Host maintenance | yes (DLQ / retry / retention) | yes | DO `alarm` |

## Type-safe actions

```ts
type Actions = 'user.created' | 'user.updated';

const audit = new AuditLogger<Actions>({
  namespace: 'my-app',
  adapter,
});

audit.fire('user.created', { actorId: 'u1' });
// @ts-expect-error — not in Actions
audit.fire('user.deleted', { actorId: 'u1' });
```

Source: https://logbun-docs.abshahin.workers.dev/installation/index.mdx
