Welcome to pbkit
Generate fully typed TypeScript SDKs from your PocketBase schema.
What pbkit gives you
Section titled “What pbkit gives you”- TypeScript types — Auto-generated
XxxRecord,XxxCreate,XxxUpdate, andXxxExpandtypes for every collection. - Typed SDK — CRUD functions wrapping the PocketBase JS SDK with full type safety and autocomplete.
- Plugin system — Extend output with plugins — TanStack Query options, Zod schemas, or write your own.
Quick example
Section titled “Quick example”export default { input: "https://my-pb.example.com", output: "./src/generated", sdk: { baseUrl: "https://my-pb.example.com", },}bunx pbkit generateimport { getArticle, createArticle } from "./generated/sdk.gen"import type { ArticlesRecord } from "./generated/types.gen"
const article: ArticlesRecord = await getArticle("RECORD_ID", { expand: "author",})
const created = await createArticle({ title: "Hello", status: "draft", author: "USER_ID",})