Why Prisma IDB?
What makes Prisma IDB different from other IndexedDB wrappers
The Problem
IndexedDB is the only real storage API in the browser. It's also one of the worst developer experiences in web development: callback-based, untyped, no query language, no relations, no migration strategy. Every project that touches it ends up building a wrapper.
Most wrappers (Dexie, idb, localForage) give you a friendlier API but stop there. You still have to:
- Define your schema separately from your server schema
- Build your own sync logic when you need online/offline support
- Handle conflicts, authorization, and data ownership yourself
- Maintain type definitions manually
The Solution
Prisma IDB generates a fully-typed IndexedDB client directly from your existing Prisma schema. If you already use Prisma on the server, you define your models once and get both a server client and a browser client with the same API.
// Server (Prisma Client)
const todos = await prisma.todo.findMany({ where: { userId } });
// Browser (Prisma IDB) — same API
const todos = await idb.todo.findMany({ where: { userId } });What about sync?
This is where most IndexedDB libraries leave you on your own. Prisma IDB includes a complete bidirectional sync engine:
- Outbox pattern for reliable mutation push with retry
- Ownership DAG for structural authorization
- Changelog materialization for efficient, deterministic pulls
- Conflict resolution that doesn't require manual intervention
It's optional — you can use Prisma IDB purely as a local database. But when your app needs to go online, you flip one flag instead of building a sync system.
Good fit for
- Offline-first apps that need to work without network
- Progressive Web Apps with local data and background sync
- Collaborative tools with multi-device data
- Any app already using Prisma that wants browser-side storage
Ready to start? Head to the Quick Start guide.