Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PocketBase
  3. typed-pocketbase

typed-pocketbase

MITTypeScriptv0.1.1

A TypeScript wrapper for the PocketBase JavaScript SDK that provides full type safety and utility functions.

GitHubGitHub
111 stars12 forks0 contributors

What is typed-pocketbase?

Typed PocketBase is a TypeScript wrapper for the PocketBase JavaScript SDK that generates TypeScript types from your PocketBase database schema. It provides full type safety for queries, filters, sorting, and relation expansions, reducing runtime errors and improving developer experience when interacting with PocketBase.

Target Audience

TypeScript developers building applications with PocketBase who want type-safe database interactions and enhanced IDE support.

Value Proposition

Developers choose Typed PocketBase for its seamless integration with PocketBase, automatic type generation, and comprehensive utility functions that make building complex queries type-safe and intuitive.

Overview

Add types to the PocketBase JavaScript SDK

Use Cases

Best For

  • Adding TypeScript type safety to PocketBase projects
  • Generating TypeScript definitions from existing PocketBase schemas
  • Building complex queries with conditional filters and sorting
  • Working with nested relations and back-relation expansions in PocketBase
  • Improving IDE autocompletion and error detection for PocketBase queries
  • Reducing runtime errors in PocketBase database interactions

Not Ideal For

  • Projects built entirely in JavaScript without TypeScript, as the type safety features are unnecessary overhead
  • Teams with rapidly evolving or frequently changed database schemas, where constant type regeneration would be cumbersome
  • Developers relying on dynamic, runtime-defined queries that cannot be statically typed
  • Environments where CLI tool access is restricted, making automated type generation difficult

Pros & Cons

Pros

Automatic Type Generation

The CLI tool generates TypeScript types directly from your PocketBase instance, ensuring all collections, fields, and relations are fully typed, as shown in the usage example where types are imported from a generated file.

Comprehensive Filter Utilities

Provides helper functions like `eq`, `and`, and `or` for building type-safe filters, making query construction intuitive and reducing runtime errors, as demonstrated in the filtering examples.

Conditional Query Support

Allows conditional filtering and sorting where falsy values are automatically excluded, simplifying dynamic query logic without manual cleanup, as illustrated with the `untilNow` variable example.

Deep Relation Typing

Supports type-safe expansions up to six levels deep, including back relations, enabling complex nested selects with full IDE support, as shown in the expand section.

Cons

CLI Dependency

Requires running a separate CLI command to generate types, which adds an extra step to the workflow and must be repeated on every schema change, potentially slowing down development cycles.

Fixed Expansion Depth

Expansions are limited to six levels deep, as stated in the README, which might not suffice for applications with extremely nested or complex relation structures.

Potential Type Staleness

If PocketBase schema updates are not promptly reflected by regenerating types, the TypeScript definitions can become outdated, leading to silent errors or false positives in type checking.

Frequently Asked Questions

Quick Stats

Stars111
Forks12
Contributors0
Open Issues5
Last commit2 years ago
CreatedSince 2023

Tags

#developer-tools#type-safety#typescript#database-client#code-generation#sdk-wrapper#pocketbase

Built With

T
TypeScript
N
Node.js

Included in

PocketBase1.2k
Auto-fetched 19 hours ago

Related Projects

pocketbase-querypocketbase-query

A pocketbase query builder

Stars60
Forks1
Last commit1 year ago
pocketbase-schema-generatorpocketbase-schema-generator

PocketBase hook for automatically generating TypeScript interfaces and Zod schemas

Stars40
Forks2
Last commit6 months ago
pb-querypb-query

A type-safe PocketBase query builder

Stars38
Forks1
Last commit1 month ago
pocketbase-tspocketbase-ts

Fully-typed Pocketbase SDK with more readable option syntax

Stars36
Forks0
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub