SKILL

pb-hooks

Server-side JavaScript hooks for PocketBase (pb_hooks). Use when writing custom routes, event hooks, cron jobs, sending emails, making HTTP requests, querying the database, or extending PocketBase with server-side logic. Covers the goja ES5 runtime, routing, middleware, all event hooks, DB queries, record operations, and global APIs.

Target: Databases. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • PocketBase Server-Side JavaScript (pbhooks)
  • Runtime Basics
  • Routing
  • Adding routes
  • Path patterns
  • Response methods
  • Reading request data
  • Middleware

Files go in pbhooks/.pb.js (must end with .pb.js) Engine: goja — ES5.1 + some ES6. No ES6 modules (import/export), no async/await, no arrow functions in older versions. Use function(){} and CommonJS require(). Each file is loaded on app start and on hot-reload hooks — absolute path to the pbhooks directory TypeScript declarations: pbdata/types.d.ts (auto-generated, useful for IDE support) --hooksPool=25 flag controls concurrent JS goroutines (default: 25) Each handler runs in an isolated context — no shared mutable state between requests {name} — named path parameter {path...} — wildcard (matches rest of path) {$} — exact match (no trailing slash) | Method | Usage | |--------|-------| | e.json(status, data) | JSON response | | e.string(status, text) | Plain text | | e.html(status, html) | HTML response | | e.redirect(status, url) | Redirect (301/302) | | e.blob(status, contentType, bytes) | Binary data | | e.stream(status, contentType, reader) | Streaming response | | e.noContent(status) | No body (204) | Priority: middleware runs in order — first registered, first executed. Each record event has 3 variants: onRecordExecute — wraps the default action. Call e.next() to proceed. onRe

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
davila7/claude-code-templates
Source file
cli-tool/components/skills/pocketbase/pb-hooks/SKILL.md
Fixed revision
21be197f100a12b8d0dd9a211cc244c8179f84d3
Read the complete original documentation ↗

Requirements

  • Only the author’s Skill metadata is included. Read the full instructions to check dependencies, licensing and conditions of use.

A small first task

先阅读原作者说明,再决定是否在自己的 AI 工具中使用。

Instructions for your AI tool

Author documentation is not live verification by this site. Without evidence, we do not mark a resource as compatible, safe or free.

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: davila7/claude-code-templates · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:39.587Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.