Declarative, Type-Safe ORM for IndexedDB
Define your data models with TypeScript decorators. Schema creation, validation, and transactions handled automatically - no external dependencies.
npm install idb-ts
Engineered for Reliability
Declarative Entities
Define your database schema using standard TypeScript decorators. No more complex migrations or JSON-based configurations.
Typed Query
Full autocomplete for keys and relationships.
Validation
Built-in field constraints and types.
Auto Timestamps
Automatic createdAt/updatedAt management.
Transaction API
Ensure ACID compliance in your browser storage with robust transaction handling.
Data Retention
Persist state across sessions reliably.
Get up and running in minutes
Define your model, build the connection, and start querying. It's that simple. No more wrestling with IndexedDB's low-level EventTarget API.
- check_circle Automatic Store Creation
- check_circle Built-in Primary Key Generation
- check_circle Intelligent Query Caching
import { Entity, PrimaryKey, Property } from 'idb-ts'; @Entity('users') export class User { @PrimaryKey({ autoIncrement: true }) id: number; @Property({ unique: true }) email: string; @Property() username: string; } // Usage const db = await IDB.build({ entities: [User] });
Ready to simplify your storage?
Start building type-safe browser applications today with the most lightweight ORM in the ecosystem.