@doshi/typesaurus
v11.0.0
Published
Type-safe ODM for Firestore — Doshi fork of typesaurus, maintained against current Firebase SDKs.
Maintainers
Readme
@doshi/typesaurus— a maintained fork of typesaurus by Sasha Koss.Upstream is unreleased since 2024-06-30. This fork is maintained by Doshi to keep the library current with the latest Firebase JS SDK and Firebase Admin SDK features. See NOTICE.md for attribution, LICENSE for the MIT license, and CHANGELOG.md for fork-specific changes.
Original maintainer: please reach out at [email protected] — happy to upstream changes.

🦕 Typesaurus (@doshi/typesaurus)
TypeScript-first ODM for Firestore.
Looking for React adaptor? Check Typesaurus React!
Why?
- Designed with TypeScript's type inference in mind
- Universal code (browser & Node.js)
- Uncompromised type-safety
- Code autocomplete
- Say goodbye to any!
- Say goodbye to exceptions!
- Ready to start? Follow this guide.
Installation
The fork is published as @doshi/typesaurus:
pnpm add @doshi/typesaurus firebase firebase-adminNote that Typesaurus requires the firebase package to work in the web environment and firebase-admin to work in Node.js. These packages aren't listed as dependencies, so they won't install automatically with the Typesaurus package.
Migrating from upstream
typesaurus? Replace the import:import { schema } from 'typesaurus'→import { schema } from '@doshi/typesaurus'. The public API is unchanged at the fork point.
Features
- Complete type-safety: uncompromised type-safety, includes Firestore quirks.
- Universal package: reuse the same code on the client and server.
- JavaScript-native: converts Firestore data types, i.e. timestamp, to native JS types, i.e.
Date. - Build size-efficiency: optimized build-size for web.
- Typed ids: all document ids are types, so you'll never mix up a user id with an account id.
- Centralized schema: easy to define, read and update.
- Single-import principle: single import to define, single import to use.
Changelog
See the changelog.
