서우 AgentOffice
← 라이브러리
pocketbase

PocketBase Hooks

원문: PocketBase 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

무엇을 하나요

PocketBase Server Side JavaScript (pb hooks) Runtime Basics Files go in pb hooks/ .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 pb hooks directory TypeScript declarations: pb data/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 Routing Adding routes Path patterns {name} — named path parameter {path...} — wildcard

실행 시 본인 API 키(BYOK)로 동작하며, 모델 비용은 사용자 계정에서 직접 결제됩니다.