pb_hooks used to accept exactly three things: .pb.js, .js, and .json,
all sitting flat in one directory. A hook that wanted an email template, a
static HTML fragment, or a CSV of seed data had nowhere to put it — and a
lib/ folder to organize a growing set of hooks was refused outright, on the
portal, the CLI, and a full archive deploy alike.
The extension list is now much longer. Alongside .pb.js, .js,
.mjs, .cjs, and .json, you can push .html, .htm, .css, .txt,
.md, .csv, .xml, .svg, .yml, and .yaml. PocketBase’s hook loader
still only executes *.pb.js — everything else is there for your hook code to
require() or read, the same way a helper module always was.
Subdirectories are allowed, up to five levels deep. pb_hooks/emails/welcome.html
now uploads and installs exactly where you’d expect, whether you push it from
the portal’s Hooks editor, pbc pocketbase hooks push, or a full
pbc pocketbase deploy. The portal editor also picks the right syntax
highlighting for whatever you’re editing, instead of always assuming
JavaScript.
The file-count ceiling went from 30/50 to 500, consistently across the
CLI’s own guard rail and the platform’s limit — there’s no longer a gap where
the CLI refuses a push the portal or a direct API call would have accepted.
Real binary files — images, PDFs, anything that isn’t text — still aren’t
supported in pb_hooks; that’s what pb_public is for, and it already
accepts any file type through a full deploy.
See Extending with Hooks for the
full list of supported extensions and how pushing works from the CLI and the
portal.