Dexie.js turns IndexedDB into a promise API with live queries
A Minimalistic Wrapper for IndexedDB
At a glance
- What is it?
- The Apache-2.0 library for browser storage wraps IndexedDB in promises, adds reactive hooks for React, and writes bulk data far faster than the raw API. Used by more than 100,000 sites and apps.
- Who is it for?
- Dexie sits in a narrow and useful place. It does not replace IndexedDB with a different storage engine, and it does not bring a sync backend or a query language you have to learn from scratch.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 10 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- dexie/Dexie.js14,690 ★ · +56
| Repository | 2026-10-12 | 2026-11-25 |
|---|---|---|
| dexie/Dexie.js | 14.6k | 14.7k |
56 Stars in the last 44 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
A schema string replaces the version upgrade callback
The difference shows up in the first four lines you write. Raw IndexedDB asks you to open a connection, and if the store set does not match what is already on disk it fires an `onupgradeneeded` handler where you create object stores and indexes by hand. Dexie replaces that ceremony with one string:
const db = new Dexie('FriendDatabase');
db.version(1).stores({
friends: '++id, age'
});`'++id, age'` is a schema declaration, not SQL. `++id` is an auto-incrementing primary key and `age` is an index, so `age` queries do not have to scan. Declaring version 2 means writing `db.version(2).stores({ friends: '++id, age, name' })` and Dexie computes the migration, which is the part people tend to get wrong by hand.
From there the stores become properties on the database object. `db.friends` is a table with methods on it, and every one of them returns a promise:
await db.friends.add({ name: 'Alice', age: 21 });
const youngFriends = await db.friends
.where('age')
.below(30)
.toArray();The `where('age')` call resolves to the indexed `age` field, `below(30)` narrows the range, and `toArray()` collects the matches. The README calls this `Yes, it's that simple`, which is fair for a hello world and generous for everything past it.
Three ways to load the same six lines
The README documents the entry points separately, which is useful because getting the URL wrong is the most common first-day problem. For a plain page, the ES module build straight from the CDN:
<script type="module">
import { Dexie } from 'https://unpkg.com/dexie/dist/modern/dexie.mjs';
</script>For a page that cannot use modules, the legacy UMD bundle attaches a global:
<script src="https://unpkg.com/dexie/dist/dexie.js"></script>For a bundled project, `package.json` names the package `dexie` and maps the entry point per environment. `main` is `dist/dexie.js`, `module` and `jsnext:main` are `dist/dexie.mjs`, typings live at `dist/dexie.d.ts`, and the `exports` field has separate `production` and `development` branches. In the current `package.json`, the `production`, `development` and `default` branches all resolve `require` to `./dist/dexie.js` and `import` to `./import-wrapper.mjs`.
Live queries replace manual refetching in React
A React component that reads from IndexedDB has a problem the `useState` version never did: nothing tells it when to re-read. Dexie ships a companion package, `dexie-react-hooks`, whose `useLiveQuery` observes the tables a query touches and re-runs it when they change:
const youngFriends = useLiveQuery(() =>
db.friends
.where('age')
.below(30)
.toArray()
);The subscription is derived from the query itself. There is no effect array to keep in sync and no invalidation call to remember after a write.
Typing the tables is where the TypeScript example earns its keep. Rather than declaring the shape of the database separately, the example casts the instance to a `Dexie` with typed tables:
import { Dexie, type EntityTable } from 'dexie';
import { useLiveQuery } from 'dexie-react-hooks';
export const db = new Dexie('FriendDatabase') as Dexie & {
friends: EntityTable<Friend, 'id'>;
};`EntityTable<Friend, 'id'>` means `db.friends.add` wants a `Friend` and `db.friends.get` takes an `id`. Without that cast every property lookup on the database is an error, because Dexie is one object holding stores you declare at runtime.
Tutorials for React, Svelte, Vue, Angular and vanilla JS are linked from the README.
Bulk writes skip the per-record event handler
The performance argument for the wrapper is narrow and specific, and the README is honest about where it comes from. IndexedDB exposes a lesser-known feature that lets a transaction store many records without waiting on an `onsuccess` event for each one. Dexie's bulk methods use it:
bulkAdd(items: Array): Promise;
bulkDelete(keys: Array): Promise;
bulkPut(items: Array): Promise;If you are importing thousands of records, calling `put` in a loop and awaiting each one is the slow path, and it is the path most people write first because it is the obvious one. The bulk variants are the difference between a progress bar and a frozen tab.
The rest of the surface is large enough that the README prints it as a reference list rather than prose, mixing methods from `WhereClause`, `Table` and `Collection`. Range and prefix matching cover `above`, `below`, `between`, `anyOf`, `noneOf`, `startsWith` and `startsWithIgnoreCase`, there are both `equals` and `equalsIgnoreCase`, and result shaping includes `limit`, `offset`, `reverse`, `sortBy`, `distinct`, `filter`, `and`, `or`, `until` and `each`. Two methods accept both a callback and an object of changes: `modify`, and `update` alongside it. Knowing that list exists in full is often more useful than memorising it, since the API reference covers the details.
The companion packages define the real scope
The repository is a workspace, and `pnpm-workspace.yaml` sits next to `addons/`.
`dexie-cloud-addon` is the largest of them: sync across devices, authentication, access control, file and blob storage, and offline-first behaviour, with the README's summary being that you keep writing frontend code and it handles the backend. Alongside it sits `dexie-react-hooks` for reactive components, while the README marks the older `dexie-observable` and `dexie-syncable` addons as legacy and no longer maintained.
None of that is in the core package. Core Dexie is a local storage library with Apache-2.0 licensing, and everything about cross-device state lives in a separate dependency.
What three patch releases say about the code
The recent tags are v4.4.5 on 2026-08-14, v4.4.6 on 2026-09-10 and v4.4.7 on 2026-10-19, and `package.json` on the default branch carries version 4.4.7, a steady patch cadence on the 4.4 line.
The adoption claim and where it does not apply
The README makes a specific adoption claim: more than 100,000 websites, apps and other projects use Dexie, across all browsers, Electron for desktop, Capacitor for iOS and Android, and plain PWAs. It also states that Dexie works around bugs in IndexedDB implementations, which is the part that matters most when you read the repository rather than the marketing.
What it is not is a replacement storage engine. Data goes into the browser's IndexedDB, which means the same quotas, the same clearing behaviour under storage pressure, and the same fact that the data lives on one device. Anyone who needs a server-side relational database is looking at the wrong library, and the comparison to SQLite is a comparison of different things.
The other boundary is the ecosystem. A wrapper that exposes IndexedDB faithfully will also expose IndexedDB's shape, including the requirement that queries go through an index or a primary key, and the fact that a schema change is a version bump in a string you wrote. Dexie's own advice is to read the docs after the hello world, and the API reference is where the depth is.
Editorial conclusion
Dexie sits in a narrow and useful place. It does not replace IndexedDB with a different storage engine, and it does not bring a sync backend or a query language you have to learn from scratch. What it replaces is the ceremony around IndexedDB: callback pairs that leak out of every method, version upgrades written as transaction callbacks, and no way to re-render a component when the data underneath it changes. The cost is a dependency, a schema string that only Dexie understands, and a layer between you and the browser API when something goes wrong. The recent releases suggest an actively maintained codebase, with v4.4.5, v4.4.6 and v4.4.7 shipped between August and October 2026. For local-first browser storage that needs a real query surface and reactive components, that trade reads as a good one. The package is Apache-2.0, the npm package is `dexie`, and the project was last pushed on 2026-10-30.
Frequently asked questions
What is Dexie.js?
Dexie.js is a minimalistic Apache-2.0 wrapper around IndexedDB, the browser's built-in database. It turns the native callback API into promises, declares schemas as short strings instead of version upgrade callbacks, and adds companions for reactive React components and optional cloud sync. The repository describes it as used by more than 100,000 sites and apps.
How do you use Dexie.js in a project?
Create a database instance with a name, declare the stores and their indexes with `db.version(1).stores({...})`, then treat each store as a property with promise-returning methods. Load it from a CDN as an ES module, from the UMD bundle as a global, or install the npm package `dexie`. In React, wrap reads in `useLiveQuery` from dexie-react-hooks so the component updates when the data changes.
Is Dexie.js free and open source?
Yes. Dexie is published on npm under the package name `dexie` and carries the Apache-2.0 license, with the license text and a NOTICE file in the repository root. The core library is free to use. Dexie Cloud, which adds real-time sync, authentication and access control on top, is a separate add-on (`dexie-cloud-addon`), hosted or self-hosted.
Dexie.js or raw IndexedDB, which should you use?
Raw IndexedDB has no dependency and no abstraction to learn, so it wins if your data model is small and fixed or you need precise control over transactions and object stores. Dexie wins on everything that comes from the wrapper: promises instead of request and event pairs, computed schema migrations, a large indexed query surface, bulk writes that skip per-record events, and `useLiveQuery` for reactive components. The trade is a dependency and a layer between you and the browser API when something breaks.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/dexie-dexie-js)Star history chart for your README
[](https://hysenlabs.com/projects/dexie-dexie-js)Was this useful?