PocketBase TypeScript Type Generator

This tool lets you generate TypeScript types from your PocketBase collections.

  1. In the PocketBase admin dashboard, go to SettingsExport collections.
  2. Click Copy to copy the JSON export of your collections.
  3. 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)
}