Generate TypeScript types from your PocketBase collections in seconds.
bun add pockettypes- Create a
.pocketbase.config.tsfile:
export default {
url: 'https://your-pb-instance.com',
username: 'admin@example.com',
password: 'your-password'
}- Generate types:
bun generateThis creates pb.types.ts with interfaces for all your collections:
interface Base {
id: string;
created: string;
updated: string;
}
interface User extends Base {
name: string;
avatar: string;
post_id: string;
}
interface Post extends Base {
title: string;
content: string;
author_id: string
}- Generates TypeScript interfaces from PocketBase collections
- Handles relations with proper typing
- Supports all PocketBase field types
- Generates expand interfaces for relations
- Excludes views by default
- Adds proper nullability
- Supports custom fields
MIT © thisuxhq