raisindb-functions-triggers
Functions and Triggers
Functions are JavaScript handlers stored as nodes inside a RAP package. Triggers watch for events (node changes, schedules, webhooks) and invoke functions when conditions match. Together they form the server-side logic layer of RaisinDB.
BEFORE writing any server-side function code:
- Run
npm installin the project root — this installs@raisindb/functions-typeswhich containsraisin.d.ts, the COMPLETE TypeScript API for the function runtime. Read it before writing any code. - ONLY use methods defined in
raisin.d.ts— this is NOT Node.js (noBuffer,fs, no npm modules).fetch()IS available. ES module imports with relative paths ARE supported (import { foo } from './utils.js').
MANDATORY: After creating or modifying ANY .yaml, .node.yaml, or .js file in package/, immediately run:
npm run validate
File Organization
content/functions/
├── lib/{namespace}/{function-name}/
│ ├── .node.yaml # raisin:Function definition
│ └── index.js # JavaScript implementation
More from maravilla-labs/raisindb
raisindb-sql
SQL syntax for querying RaisinDB workspaces: CRUD, JSONB properties, hierarchy queries, graph relations, full-text search. Use when writing queries in frontend or server-side functions.
3raisindb-auth
Authentication flows for RaisinDB apps: anonymous access, login, register, session management, auth state listeners. Use when adding authentication to your frontend.
3raisindb-translations
Multi-language content with translation files and locale-based queries. Use when adding internationalization to your RaisinDB app.
3raisindb-file-uploads
Upload, store, and display files using the raisin:Asset system. Covers single/batch uploads, progress tracking, signed URLs, and thumbnails. Use when adding file handling to your app.
3raisindb-frontend-react
Build a React Router frontend for your RaisinDB app with path-based routing, archetype-to-component mapping, and SSR-to-WebSocket upgrade. Use when creating a React frontend.
3raisindb-overview
Core concepts of RaisinDB content-driven applications. Use when building any RaisinDB app. Teaches: path-as-URL routing, archetype-to-component mapping, content modeling, project structure.
3