Extending PocketBase with Go or JavaScript
masterYou can extend the backend functionality in two ways:
- JavaScript Hooks: Easy development using JS. Example logic can be found in
./pb/pb_hooks/main.pb.ts. The server automatically hot-reloads when files in./pb/pb_hookschange. - Golang Extensions: Full performance. You can implement custom API endpoints (e.g.,
/api/hello) and database event hooks (e.g., executing Go handlers when a row is created) by modifyingmain.go. If usingmodd, the server will hot-reload when Go code changes.