PocketBase TypeScript Type Generator
This tool lets you generate TypeScript types from your PocketBase collections.
- In the PocketBase admin dashboard, go to Settings → Export collections.
- Click Copy to copy the JSON export of your collections.
- Paste the JSON into the textarea below.
Generated TypeScript Code
/* Generated code will display here */
You can use the generated types like this:
function collection<T extends keyof Collections>(name: T) {
return pb.collection<Collections[T]>(name)
}