Introduction
A Prisma generator for type-safe IndexedDB with optional bidirectional sync
Prisma IDB
You already write Prisma on the server. Now write it in the browser.
Prisma IDB is a Prisma generator that creates a type-safe IndexedDB client with the familiar Prisma Client API. Define your data model once in your Prisma schema, and get a local-first client that works offline — with an optional sync engine that handles conflict resolution and authorization.
const todos = await idb.todo.findMany({
where: { userId, done: false },
});Core Features
- Prisma-compatible API —
create,findMany,findUnique,update,delete,upsert, and more - Full type safety — generated from your schema with complete autocomplete
- Local-first — all data in IndexedDB, works offline by default
Sync Engine
When you're ready for server sync, one flag enables:
- Outbox pattern — reliable push with retry and batching
- Ownership DAG — structural authorization tracing records to their owner
- Conflict resolution — server-authoritative changelog materialization
Learn more in the Synchronization section.
See the live Kanban demo or explore the source code.