Appnest Functions — Overview
Appnest splits "functions" into two surfaces: backend helpers used inside server handlers, and a client API used to invoke those handlers by name.
Backend — From AppnestFunctions (e.g. require('@sparrowengg/appnest-app-sdk-utils')), destructure what you need: $db (typed key/value storage), $fetch (outbound HTTP), $file (signed upload/download and object ops), $next (invoke another backend function), $schedule (one-time, cron, recurring jobs), and getTraceId (request correlation). The platform supplies this package at runtime for backend code; use it for storage, HTTP, files, chaining functions, and scheduling.
Frontend — From the iframe client bridge, await window.AppnestFunctions.$app.backend({ functionName, functionPayload, options? }) POSTs to the platform backend-invoke endpoint, attaches app/trace context, and resolves to the parsed JSON body of the HTTP response (not a { data, status } wrapper). Use it whenever the UI needs to call a named server function.
await window.AppnestFunctions.$app.backend({
functionName: 'myServerHandler',
functionPayload: { foo: 'bar' },
});
For signatures, parameters, return shapes, and code-generation detail, see appnestFunctionsBackend.md (backend) and appnestFunctionsFrontend.md (frontend / client).