Official JavaScript SDK for interacting with the PocketBase API in browser and Node.js environments.
PocketBase JavaScript SDK is the official client library for interacting with the PocketBase backend API. It enables developers to perform CRUD operations, manage authentication, handle file uploads, and subscribe to real-time updates from JavaScript applications running in browsers, Node.js, or React Native. It solves the problem of building a consistent and type-safe interface to communicate with PocketBase services across different environments.
JavaScript developers building frontend or full-stack applications that use PocketBase as their backend, including those working with React, Vue, Svelte, or Node.js frameworks.
Developers choose this SDK because it is the officially maintained, feature-complete client for PocketBase with first-class TypeScript support, built-in security features like auto-escaping for filters, and detailed examples for SSR integration with popular frameworks.
PocketBase JavaScript SDK
Mirrors the full PocketBase REST API with services for Records, Files, Collections, and more, eliminating the need for manual endpoint calls across all backend features.
Includes built-in TypeScript definitions and supports custom type assertions via generics or global type overrides, ensuring end-to-end type safety for record models.
Enables real-time updates via EventSource for records and custom topics, with built-in subscription management and polyfill guidance for Node.js and React Native.
Provides pb.filter() helper to safely construct and escape filter strings, preventing injection attacks, along with CSP guidance for frontend deployments.
Works in browsers, Node.js, and React Native with configurable auth stores like LocalStorage and AsyncAuthStore, plus SSR examples for major frameworks.
Requires manual polyfills for fetch and EventSource in Node.js <17 and React Native, adding setup overhead and potential compatibility issues in server environments.
Server-side rendering requires framework-specific manual setup, with the README admitting there's no 'one size fits all' solution, leading to repetitive boilerplate code.
Tightly coupled to PocketBase's API; migrating to another backend would necessitate a complete rewrite of client-side data layer and authentication logic.
Default auto cancellation of duplicate requests can silently drop intended API calls if not configured carefully, especially in rapid-fire or concurrent operations.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.