Overview

Get a first glimpse of how to set Jazz up and how to use it from the server and clients.

Jazz is a relational database that runs inside your backend, with real-time queries and permissions built in. Query and update data from your server or directly from your frontend, using a thin client or a local-first client for offline support.

Every Jazz app is defined first by its database schema and permission policies. You write both in TypeScript, in schema.ts.

schema.ts
import { schema as s } from "jazz-tools";
​
export const schema = s.defineSchema({
todos: s.table({
title: s.string(),
done: s.boolean(),
}),
});
​
const { definePermissions, session } = schema;
​
// Each user sees and edits only the todos they created
const createdByMe = { $createdBy: session.user };
​
export const permissions = definePermissions({
todos: {
read: createdByMe,
insert: createdByMe,
update: createdByMe,
delete: createdByMe,
},
});

Run npx jazz-tools generate after writing it, and again after each change. It checks the schema and permissions and writes jazz.app.json, jazz.permissions.json and jazz.generated.ts, the typed app your code imports. Commit all of them. See Defining Tables.

Jazz runs inside your backend: no separate database server and no deploy step. The schema and permissions your backend imports are the ones it enforces.

server.ts
import { Hono } from "hono";
import { createJazz, sqlite } from "jazz-tools/backend";
import { app } from "./jazz.generated";
import permissions from "./jazz.permissions.json" with { type: "json" };
​
const jazz = createJazz({
app,
permissions,
store: sqlite({ path: "./data/jazz" }),
authenticate: async (request) => getSignedInUser(request), // your own auth: { userId, expiresAt } or null
});
​
new Hono()
// Runs with backend authority and sees every todo (check admin access in your app first)
.get("/admin/todos", async (c) => {
return c.json(await jazz.db.all(app.todos));
})
// Runs as the signed-in user: the query only returns their own todos
.get("/todos", async (c) => {
const db = await jazz.forReqUser(c.req.raw);
return c.json(await db.all(app.todos.where({ done: false })));
})
// Sync for browsers, on your own origin
.all("/jazz/*", (c) => jazz.handle(c.req.raw));

You can also query and write to the database right from your frontend. It is protected by the same auth as your backend, and the same permission policies apply. Pick a thin client (about 160 KB gzipped) or a full local-first client (its Wasm engine adds about 4 MB gzipped).

client.ts
import { createJazzClient } from "jazz-tools/client";
import { app } from "./jazz.generated";
​
// Asks your backend's /jazz route who is signed in, with your app's own session cookie
const session = await createJazzClient({ serverUrl: "/jazz" });
const db = session.db; // the signed-in user's Db
​
// Live query: updates as soon as the server (or anyone else) changes a todo
db.subscribe(app.todos.where({ done: false }), (todos) => {
console.log(todos);
});

Set up the client: Thin Client (the default) or Local-First Client (offline, instant UI).

Start here

Quickstart
Why Jazz
How Jazz works

What you'll learn, in order

  • Setup — run locally, deploy to Vercel or your own server, add a backend, then a client
  • Schemas & Policies — tables, column types, relationships, who can do what, and migrations
  • Reading Data — queries, live subscriptions and framework hooks
  • Writing Data — inserts, updates, transactions and mergeable text
  • Operating Jazz — backups, upgrades, monitoring and scaling
  • Tooling — CLI, MCP, inspector and testing

What people build with Jazz

Note

Preview: rough sketches of each scenario; each will link to a short path through the docs.

  • A backend with live data. Your API or server components read from and write to Jazz directly, with permissions checked per user and live queries pushed to the browser. Path: Quickstart → User-scoped use → Declarative Permissions → Thin client.
  • A collaborative app. Shared lists, boards or documents that several people edit at once, with mergeable text and edit history. Path: Mergeable text → Shared access → Edit metadata.
  • An app that works offline. Field tools, note-taking or mobile apps that keep working without a connection. Path: start thin, then go local-first on the screens that need it, or use the React Native client.
  • Agents and automations. Background jobs and AI agents that read and write the same data as your users, attributed and permission-checked. Path: Backend Client → How Auth Works → CLI & MCP.
  • Drafts and review flows. Edit a copy, compare it with the original, merge it back. Path: Drafts & branches.

Recipes

Examples and help