> For the complete documentation index, see [llms.txt](https://jacksonkasi.gitbook.io/tablecraft/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jacksonkasi.gitbook.io/tablecraft/getting-started/packages.md).

# Packages Overview

> **Next.js compatibility:** `@tablecraft/adapter-next` requires Next.js `>=15.5.18 <16` or `>=16.2.6`. Earlier releases are excluded due to GHSA-gx5p-jg67-6x7h and GHSA-26hh-7cqf-hhc6.

TableCraft is a monorepo with multiple packages for different use cases.

## Core Packages

{% tabs %}
{% tab title="@tablecraft/engine" %}
The heart of TableCraft - handles query building, filtering, sorting, pagination, and metadata.

```bash
pnpm add @tablecraft/engine
```

**Features:**

* Table configuration with `defineTable()`
* Query building with filtering, sorting, pagination
* Computed columns and transforms
* Relationships and joins
* Metadata API
  {% endtab %}

{% tab title="@tablecraft/table" %}
React DataTable component with zero-config setup.

```bash
pnpm add @tablecraft/table
```

**Styles setup (Tailwind CSS v4):**

```css
@import "@tablecraft/table/styles.css";
@source "../node_modules/@tablecraft/table/src";
```

**Features:**

* Auto-generates columns from metadata
* Server-side pagination, filtering, sorting
* Date range picker
* Column visibility & resizing
* Export to CSV/JSON
  {% endtab %}

{% tab title="@tablecraft/client" %}
Frontend SDK for direct API calls (non-React).

```bash
pnpm add @tablecraft/client
```

**Features:**

* Type-safe query builder
* Direct API calls
* Metadata fetching
  {% endtab %}

{% tab title="@tablecraft/codegen" %}
TypeScript type generator from API metadata.

```bash
pnpm add -D @tablecraft/codegen
```

**Features:**

* Generate Row & Filters interfaces
* Generate typed adapter factories
* CLI tool for CI/CD
  {% endtab %}
  {% endtabs %}

## Backend Adapters

{% tabs %}
{% tab title="Hono" %}
Adapter for Hono.js framework.

```bash
pnpm add @tablecraft/adapter-hono
```

```typescript
import { createHonoApp } from "@tablecraft/adapter-hono";
app.route("/engine", createHonoApp({ db, schema, configs }));
```

{% endtab %}

{% tab title="Express" %}
Adapter for Express.js framework.

```bash
pnpm add @tablecraft/adapter-express
```

```typescript
import { createExpressRouter } from "@tablecraft/adapter-express";
app.use("/engine", createExpressRouter({ db, schema, configs }));
```

{% endtab %}

{% tab title="Next.js" %}
Adapter for Next.js API routes.

```bash
pnpm add @tablecraft/adapter-next
```

```typescript
// app/api/engine/[...tablecraft]/route.ts
import { createNextHandler } from '@tablecraft/adapter-next';
export { GET, POST } = createNextHandler({ db, schema, configs });
```

{% endtab %}

{% tab title="SvelteKit" %}
Adapter for SvelteKit server hooks or `+server.ts` routes.

```bash
pnpm add @tablecraft/adapter-sveltekit
```

```typescript
// src/hooks.server.ts
import type { Handle } from '@sveltejs/kit';
import { createSvelteKitHandle } from '@tablecraft/adapter-sveltekit';

export const handle: Handle = createSvelteKitHandle({
  db,
  schema,
  configs,
  prefix: '/api',
});
```

{% endtab %}

{% tab title="Elysia" %}
Adapter for Elysia (Bun framework).

```bash
pnpm add @tablecraft/adapter-elysia
```

```typescript
import { createElysiaPlugin } from "@tablecraft/adapter-elysia";
app.use(createElysiaPlugin({ db, schema, configs }));
```

{% endtab %}
{% endtabs %}

## Plugins

### @tablecraft/plugin-cache

Caching plugin with multiple backends.

```bash
pnpm add @tablecraft/plugin-cache
```

**Supported Backends:**

* In-memory cache (default)
* Redis
* Upstash Redis

```typescript
import { cachePlugin, memoryCache } from "@tablecraft/plugin-cache";

const engine = createTableEngine({
  db,
  schema,
  config,
  plugins: [
    cachePlugin({
      adapter: memoryCache({ ttl: 60000 }),
    }),
  ],
});
```

## Version Compatibility

| Package | Node | React | Drizzle |
| ------- | ---- | ----- | ------- |
| engine  | >=18 | -     | ^0.30   |
| table   | -    | >=18  | -       |
| codegen | >=18 | -     | -       |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://jacksonkasi.gitbook.io/tablecraft/getting-started/packages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
