Functions
Server logic as published TypeScript functions — how they are written, what they may touch, and how a page or a flow runs one.
A function is a small program in TypeScript that runs on the server, sandboxed, when a URL or a flow step calls it. It is how a site gets custom server logic without anyone writing server code into the site itself.
Writing one
In Coder, a function is a folder with a manifest and an entry file. The manifest names the function and declares what it needs: read your data, write it, change structure, reach the network, spend credits. The declaration is checked against the platform's capability catalog when you publish.
Publishing and grants
Publishing stores an immutable version. What the function declared decides what happens next:
- Control, read and write — self-serve; it can run.
- Structure changes, network, spending, platform-level — an escalation; a person grants it before it runs.
Every run is recorded.
Running one
- From a URL — create a URL of type Function with the function's name; requests to that path run it, as a page or as an API.
- From a flow — the Function call step runs it with input and keeps the result.
- From an agent — the call-function tool.
Why not PHP
Site logic in TypeScript is sandboxed, versioned and declares its reach; that is what makes it safe for agents and for you to publish freely.