The standard way to modify PocketBase is through event hooks in your Go code.

All hooks have 3 main methods:

To remove an already registered hook handler, you can use the handler id and pass it to Unbind(id) or remove all handlers with UnbindAll() (!including system handlers).

All hook handler functions share the same {`func(e T) error`} signature and expect the user to call e.Next() if they want to proceed with the execution chain.

If you need to access the app instance from inside a hook handler, prefer using the e.App field instead of reusing a parent scope app variable because the hook could be part of a DB transaction and can cause deadlock.

Also avoid using global mutex locks inside a hook handler because it could be invoked recursively (e.g. cascade delete) and can cause deadlock.

You can explore all available hooks below:

{#each eventHooks as group} {#if group.description}{@html group.description}{/if} {#if group.hooks}
{#each Object.entries(group.hooks) as [hookTitle, hookInfo]} {#if hookInfo.go}
{@html hookInfo.html}
{/if} {/each}
{/if} {/each}