sb_function
Create, update, test, and monitor server-side TypeScript/JavaScript functions that access site secrets, collections, and fetch; manage logs, usage, and secrets for owner/admin use.
Instructions
Backend functions: server-side TS/JS at /wb/fn/ with the site's secrets, collections and fetch ("" slug = importable module). Not sb_code. action: list | get | set (no id creates; id merges) | remove (id, or secret key) | test (method/path/query/headers/cookies/body) | logs | usage | secret (no key lists; key+value sets). Owner/admin only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | logs: filters to it | |
| key | No | ||
| body | No | ||
| path | No | ||
| slug | No | ||
| limit | No | ||
| query | No | ||
| value | No | ||
| action | Yes | ||
| method | No | ||
| content | No | ||
| cookies | No | ||
| dry_run | No | ||
| enabled | No | ||
| headers | No | ||
| site_id | No | ||
| language | No |